Model Breadcrumbs: Scaling Multi-Task Model Merging with Sparse Masks
Paper • 2312.06795 • Published • 2
How to use Yobenboben/MN-12B-Paskuda with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Yobenboben/MN-12B-Paskuda")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Yobenboben/MN-12B-Paskuda")
model = AutoModelForCausalLM.from_pretrained("Yobenboben/MN-12B-Paskuda")
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 Yobenboben/MN-12B-Paskuda with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Yobenboben/MN-12B-Paskuda"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Yobenboben/MN-12B-Paskuda",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Yobenboben/MN-12B-Paskuda
How to use Yobenboben/MN-12B-Paskuda with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Yobenboben/MN-12B-Paskuda" \
--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": "Yobenboben/MN-12B-Paskuda",
"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 "Yobenboben/MN-12B-Paskuda" \
--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": "Yobenboben/MN-12B-Paskuda",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Yobenboben/MN-12B-Paskuda with Docker Model Runner:
docker model run hf.co/Yobenboben/MN-12B-Paskuda
This is a merge of pre-trained language models created using mergekit.
This model was merged using the Model Breadcrumbs merge method using OddTheGreat/Sinner_12B_V.1 as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: OddTheGreat/Sinner_12B_V.1
parameters:
weight: [0.9, 1, 0.8, 0.65, 0.2, 0.05, 0.1, 0.35, 0.65, 0.8]
- model: BeaverAI/MN-2407-DSK-QwQify-v0.1-12B
parameters:
weight: [0.1, 10e-5, 10e-5, 0.1, 0.5, 0.5, 0.5, 0.35, 0.1, 10e-5]
density: [0.35, 1, 1, 0.35, 0.35, 0.5, 0.5, 0.6, 0.9, 1]
gamma: [5e-4, 5e-3, 5e-3, 5e-4, 5e-4, 0.01, 0.01, 0.01, 5e-3, 5e-4]
- model: Nitral-AI/Mag-Mell-Reasoner-12B
parameters:
weight: [10e-5, 10e-5, 0.2, 0.25, 0.3, 0.45, 0.4, 0.3, 0.25, 0.2]
density: [1, 1, 0.9, 0.9, 0.85, 0.85, 0.8, 0.85, 0.9, 0.9]
gamma: 0.03
merge_method: breadcrumbs
base_model: OddTheGreat/Sinner_12B_V.1
parameters:
int8_mask: false
rescale: true
normalize: false
dtype: float32
out_dtype: bfloat16
tokenizer_source: BeaverAI/MN-2407-DSK-QwQify-v0.1-12B