Downloads · 30 days
13
35% of all-time downloads
alaamostafa/Microsoft-Phi-2
Microsoft-Phi-2 is a machine learning model from alaamostafa. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
This is a fine-tuned version of Microsoft's Phi-2 model, adapted specifically for neuroscience domain content.
Downloads · 30 days
13
35% of all-time downloads
All-time downloads
37
Public
Repo size
62.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors62.9 MB · 93%
From the Hugging Face model README
This is a fine-tuned version of Microsoft's Phi-2 model, adapted specifically for neuroscience domain content.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto")
# Load adapter
model = PeftModel.from_pretrained(base_model, "alaamostafa/Microsoft-Phi-2")
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2")
# Generate text
input_text = "Recent advances in neuroscience suggest that"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))