Model Breadcrumbs: Scaling Multi-Task Model Merging with Sparse Masks
Paper • 2312.06795 • Published • 2
How to use schonsense/Cream_top2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="schonsense/Cream_top2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("schonsense/Cream_top2")
model = AutoModelForCausalLM.from_pretrained("schonsense/Cream_top2")
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 schonsense/Cream_top2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "schonsense/Cream_top2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "schonsense/Cream_top2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/schonsense/Cream_top2
How to use schonsense/Cream_top2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "schonsense/Cream_top2" \
--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": "schonsense/Cream_top2",
"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 "schonsense/Cream_top2" \
--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": "schonsense/Cream_top2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use schonsense/Cream_top2 with Docker Model Runner:
docker model run hf.co/schonsense/Cream_top2
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("schonsense/Cream_top2")
model = AutoModelForCausalLM.from_pretrained("schonsense/Cream_top2")
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]:]))This is a merge of pre-trained language models created using mergekit.
This model was merged using the Model Breadcrumbs with TIES merge method using schonsense/ll3_3_70B_r128_VAR2 as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
merge_method: breadcrumbs_ties
models:
- model: Delta-Vector/Austral-70B-Winton
parameters:
gamma: 0.01
density: .2
weight: 0.13
- model: Delta-Vector/Shimamura-70B
parameters:
gamma: 0.01
density: .2
weight: 0.13
- model: Darkhn/L3.3-70B-Animus-V7.0
parameters:
gamma: 0.01
density: .5
weight: 0.13
- model: TheDrummer/Anubis-70B-v1.1
parameters:
gamma: 0.02
density: .3
weight: 0.13
- model: schonsense/Llama3_3_70B_VAR_r128
parameters:
gamma: 0
density: .7
weight: 0.13
- model: SentientAGI/Dobby-Unhinged-Llama-3.3-70B
parameters:
gamma: 0.01
density: .3
weight: 0.13
- model: Tarek07/Scripturient-V1.3-LLaMa-70B
parameters:
gamma: 0.01
density: .3
weight: 0.13
- model: zerofata/L3.3-GeneticLemonade-Unleashed-v3-70B
parameters:
gamma: 0.02
density: .2
weight: 0.13
- model: schonsense/ll3_3_70B_r128_VAR2
base_model: schonsense/ll3_3_70B_r128_VAR2
tokenizer_source: union
parameters:
normalize: true
int8_mask: true
lambda: 0.95
dtype: float32
out_dtype: bfloat16
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="schonsense/Cream_top2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)