Downloads · 30 days
13
2% of all-time downloads
ayoubkirouane/Phi-2.7B_MERGED
Phi-2.7B_MERGED is a text generation model from ayoubkirouane. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model was merged using the SLERP merge method.
Downloads · 30 days
13
2% of all-time downloads
All-time downloads
551
Public
Parameters
2.8B
5.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.6 GB · 100%
From the Hugging Face model README
This model was merged using the SLERP merge method.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
slices:
- sources:
- model: rhysjones/phi-2-orange
layer_range: [0, 32]
- model: Yhyu13/phi-2-sft-dpo-gpt4_en-ep1
layer_range: [0, 32]
merge_method: slerp
base_model: rhysjones/phi-2-orange
parameters:
t:
- filter: self_attn
value: [0, 0.5, 0.3, 0.7, 1]
- filter: mlp
value: [1, 0.5, 0.7, 0.3, 0]
- value: 0.5
dtype: bfloat16
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("ayoubkirouane/phi-2_MERGED", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/phi-2_MERGED", trust_remote_code=True)
inputs = tokenizer('What Machine Learning ? ', return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=50)
text = tokenizer.batch_decode(outputs)[0]
print(text)