Resolving Interference When Merging Models
Paper • 2306.01708 • Published • 19
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Sakalti/model-3")
model = AutoModelForCausalLM.from_pretrained("Sakalti/model-3")
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 TIES merge method using Qwen/Qwen2.5-7B as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: Qwen/Qwen2.5-7B-Instruct
parameters:
weight: 1
density: 1
merge_method: ties
base_model: Qwen/Qwen2.5-7B
parameters:
weight: 1
density: 1
normalize: true
int8_mask: true
dtype: bfloat16
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 31.78 |
| IFEval (0-Shot) | 62.64 |
| BBH (3-Shot) | 36.32 |
| MATH Lvl 5 (4-Shot) | 32.33 |
| GPQA (0-shot) | 9.51 |
| MuSR (0-shot) | 11.50 |
| MMLU-PRO (5-shot) | 38.39 |
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sakalti/model-3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)