Model Stock: All we need is just a few fine-tuned models
Paper • 2403.19522 • Published • 15
How to use lemon07r/Gemma-2-Ataraxy-Remix-9B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="lemon07r/Gemma-2-Ataraxy-Remix-9B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("lemon07r/Gemma-2-Ataraxy-Remix-9B")
model = AutoModelForCausalLM.from_pretrained("lemon07r/Gemma-2-Ataraxy-Remix-9B")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use lemon07r/Gemma-2-Ataraxy-Remix-9B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "lemon07r/Gemma-2-Ataraxy-Remix-9B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "lemon07r/Gemma-2-Ataraxy-Remix-9B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/lemon07r/Gemma-2-Ataraxy-Remix-9B
How to use lemon07r/Gemma-2-Ataraxy-Remix-9B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "lemon07r/Gemma-2-Ataraxy-Remix-9B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "lemon07r/Gemma-2-Ataraxy-Remix-9B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "lemon07r/Gemma-2-Ataraxy-Remix-9B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "lemon07r/Gemma-2-Ataraxy-Remix-9B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use lemon07r/Gemma-2-Ataraxy-Remix-9B with Docker Model Runner:
docker model run hf.co/lemon07r/Gemma-2-Ataraxy-Remix-9B
Another test model. Ignore this for now. Probably wont be good but I am testing a lot of stuff.
https://huggingface.co/lemon07r/Gemma-2-Ataraxy-Remix-9B-Q8_0-GGUF
This model was merged using the Model Stock merge method using unsloth/gemma-2-9b-it as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
base_model: unsloth/gemma-2-9b-it
dtype: bfloat16
merge_method: model_stock
slices:
- sources:
- layer_range: [0, 42]
model: lemon07r/Gemma-2-Ataraxy-9B
- layer_range: [0, 42]
model: lemon07r/Gemma-2-Ataraxy-v2-9B
- layer_range: [0, 42]
model: lemon07r/Gemma-2-Ataraxy-v2a-9B
- layer_range: [0, 42]
model: jsgreenawalt/gemma-2-9B-it-advanced-v2.1
- layer_range: [0, 42]
model: ifable/gemma-2-Ifable-9B
- layer_range: [0, 42]
model: UCLA-AGI/Gemma-2-9B-It-SPPO-Iter3
- layer_range: [0, 42]
model: princeton-nlp/gemma-2-9b-it-SimPO
- layer_range: [0, 42]
model: wzhouad/gemma-2-9b-it-WPO-HB
- layer_range: [0, 42]
model: nbeerbower/gemma2-gutenberg-9B
- layer_range: [0, 42]
model: grimjim/Gemma2-Nephilim-v3-9B
- layer_range: [0, 42]
model: recoilme/Gemma-2-Ataraxy-Gemmasutra-9B-slerp
- layer_range: [0, 42]
model: UCLA-AGI/Gemma-2-9B-It-SPPO-Iter3
- layer_range: [0, 42]
model: unsloth/gemma-2-9b-it
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 29.21 |
| IFEval (0-Shot) | 70.83 |
| BBH (3-Shot) | 41.59 |
| MATH Lvl 5 (4-Shot) | 1.28 |
| GPQA (0-shot) | 11.86 |
| MuSR (0-shot) | 13.72 |
| MMLU-PRO (5-shot) | 35.99 |