DELLA-Merging: Reducing Interference in Model Merging through Magnitude-Based Sampling
Paper • 2406.11617 • Published • 10
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("TareksTesting/Scripturient-V2.2-LLaMa-70B")
model = AutoModelForCausalLM.from_pretrained("TareksTesting/Scripturient-V2.2-LLaMa-70B")
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 DELLA merge method using TareksLab/Diamond-DL-V1-LLaMa-70B as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: TareksLab/Diamond-DL-V1-LLaMa-70B
parameters:
weight: 0.10
density: 0.5
epsilon: 0.15
- model: TareksLab/Citrine-MS-V3-LLaMa-70B
parameters:
weight: [0.35, 0.25, 0.17, 0.12, 0.11]
density: 0.5
epsilon: 0.15
- model: TareksLab/Amethyst-SCE-V4-LLaMa-70B
parameters:
weight: [0.24, 0.27, 0.2, 0.16, 0.13]
density: 0.5
epsilon: 0.15
- model: TareksLab/Ruby-D-V3-LLaMa-70B
parameters:
weight: [0.17, 0.2, 0.26, 0.2, 0.17]
density: 0.5
epsilon: 0.15
- model: TareksLab/Carnelian-SCE-V4-LLaMa-70B
parameters:
weight: [0.13, 0.16, 0.2, 0.27, 0.24]
density: 0.5
epsilon: 0.15
- model: TareksLab/Emerald-SCE-V3-LLaMa-70B
parameters:
weight: [0.11, 0.12, 0.17, 0.25, 0.35]
density: 0.5
epsilon: 0.15
merge_method: della
base_model: TareksLab/Diamond-DL-V1-LLaMa-70B
parameters:
lambda: 1.1
normalize: false
dtype: float32
out_dtype: bfloat16
chat_template: llama3
tokenizer:
source: TareksLab/Ruby-D-V3-LLaMa-70B
pad_to_multiple_of: 8
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TareksTesting/Scripturient-V2.2-LLaMa-70B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)