File size: 388 Bytes
d6ab7eb |
1 2 3 4 5 6 7 8 9 |
from LM_Cocktail import mix_models_by_layers
# pip install -U LM_Cocktail && pip install sentence_transformers einops
# mix LLMs and save it to output_path: ./mixed_model_1
model = mix_models_by_layers(
model_names_or_paths=["Yhyu13/phi-2-sft-dpo-gpt4_en-ep1", "venkycs/phi-2-instruct"],
model_type='decoder',
weights=[0.5, 0.5],
output_path='./LMCocktail-phi-2-v1.1') |