Downloads · 30 days
1
4% of all-time downloads
Majipa/phi-3-samhog-psychology-6k-v1
phi-3-samhog-psychology-6k-v1 is a machine learning model from Majipa. 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 transformers. The card lists the license as apache-2.0.
- Developed by: Majipa - License: apache-2.0 - Finetuned from model : unsloth/Phi-3-mini-4k-instruct-bnb-4bit
Downloads · 30 days
1
4% of all-time downloads
All-time downloads
24
Public
Repo size
120 MB
Likes
0
Public
Click a slice to open those files.
.safetensors120 MB · 98%
From the Hugging Face model README
Fine-tuned the Phi3 model, an advanced language model developed by Anthropic, for the psychology domain using the samhog/psychology-6k dataset. Utilized Unsloth, a framework for efficient model fine-tuning, to streamline the training process. Employed Low-Rank Adaptation (LORA) and Prompt Tuning techniques from the PEFT library to enable efficient model adaptation while reducing computational requirements.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
torch.random.manual_seed(0)
model = AutoModelForCausalLM.from_pretrained(
"Majipa/phi-3-samhog-psychology-6k-v1",
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
messages = [
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
{"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
{"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": 0.0,
"do_sample": False,
}
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])