Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch
Paper • 2311.03099 • Published • 33
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("TareksTesting/Scripturient-DT-LLaMa-70B")
model = AutoModelForCausalLM.from_pretrained("TareksTesting/Scripturient-DT-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 DARE TIES merge method using TareksLab/Sapphire-V3-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/Emerald-SCE-V3-LLaMa-70B
parameters:
weight: [0.1, 0.1, 0.1, 0.1, 0.2, 0.5]
density: 0.5
- model: TareksLab/Carnelian-SCE-V4-LLaMa-70B
parameters:
weight: [0.1, 0.1, 0.1, 0.2, 0.4, 0.2]
density: 0.5
- model: TareksLab/Ruby-D-V3-LLaMa-70B
parameters:
weight: [0.1, 0.1, 0.2, 0.4, 0.2, 0.1]
density: 0.5
- model: TareksLab/Amethyst-SCE-V4-LLaMa-70B
parameters:
weight: [0.1, 0.2, 0.4, 0.2, 0.1, 0.1]
density: 0.5
- model: TareksLab/Citrine-MS-V3-LLaMa-70B
parameters:
weight: [0.2, 0.4, 0.2, 0.1, 0.1, 0.1]
density: 0.5
- model: TareksLab/Diamond-DL-V1-LLaMa-70B
parameters:
weight: [0.5, 0.2, 0.1, 0.1, 0.1, 0.1]
density: 0.5
merge_method: dare_ties
base_model: TareksLab/Sapphire-V3-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-DT-LLaMa-70B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)