Model Breadcrumbs: Scaling Multi-Task Model Merging with Sparse Masks
Paper • 2312.06795 • Published • 2
How to use Nohobby/ignore_Q2.5-test with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Nohobby/ignore_Q2.5-test")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Nohobby/ignore_Q2.5-test")
model = AutoModelForCausalLM.from_pretrained("Nohobby/ignore_Q2.5-test")
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 Nohobby/ignore_Q2.5-test with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Nohobby/ignore_Q2.5-test"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Nohobby/ignore_Q2.5-test",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Nohobby/ignore_Q2.5-test
How to use Nohobby/ignore_Q2.5-test with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Nohobby/ignore_Q2.5-test" \
--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": "Nohobby/ignore_Q2.5-test",
"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 "Nohobby/ignore_Q2.5-test" \
--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": "Nohobby/ignore_Q2.5-test",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Nohobby/ignore_Q2.5-test with Docker Model Runner:
docker model run hf.co/Nohobby/ignore_Q2.5-test
It's noticeably better than Q2.5-Qwetiapin-32B, but I'll leave it as is until arcee-ai releases a 32B R1 distill. (If that will happen though)
This model was merged using the Model Breadcrumbs with TIES merge method using arcee-ai/Virtuoso-Medium-v2 as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: arcee-ai/Virtuoso-Medium-v2
- model: maldv/Qwenstein2.5-32B-Instruct
parameters:
density: 0.5
weight: 0.4
gamma: 0.03
- model: allura-org/Qwen2.5-32b-RP-Ink
parameters:
density: 0.77
gamma: 0.007
weight: 0.07
- model: nbeerbower/Dumpling-Qwen2.5-32B
parameters:
density: 0.88
gamma: 0.008
weight: 0.28
- model: crestf411/Q2.5-32B-Slush
parameters:
density: 0.75
gamma: 0.01
weight: 0.05
base_model: arcee-ai/Virtuoso-Medium-v2
merge_method: breadcrumbs_ties
parameters:
int8_mask: true
rescale: true
normalize: true
dtype: bfloat16
tokenizer_source: base