Downloads · 30 days
17
29% of all-time downloads
iliyaML/phi-2-chatml
phi-2-chatml is a text generation model from iliyaML. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Based on: https://huggingface.co/microsoft/phi-2
Downloads · 30 days
17
29% of all-time downloads
All-time downloads
59
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
Based on: https://huggingface.co/microsoft/phi-2
Summary of changes made:
import torch
import transformers
transformers.set_seed(42)
torch.set_default_device("cuda")
model_checkpoint = "microsoft/phi-2"
tokenizer = transformers.AutoTokenizer.from_pretrained(model_checkpoint)
model = transformers.AutoModelForCausalLM.from_pretrained(model_checkpoint, torch_dtype=torch.float16, trust_remote_code=True)
num_added_tokens = tokenizer.add_special_tokens({'additional_special_tokens': ['<|im_start|>', '<|im_end|>'], 'pad_token': '[PAD]'})
model.resize_token_embeddings(len(tokenizer))