Downloads · 30 days
8
42% of all-time downloads
akingunduz/monica_llm
monica_llm is a machine learning model from akingunduz. 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.
This model is a fine-tuned version of basemodel on an FRIENDS TV Series dataset. Fine-tuning was done by taking only the parts of the dataset where Monica spoke.
Downloads · 30 days
8
42% of all-time downloads
All-time downloads
19
Public
Repo size
369 MB
Likes
0
Public
Click a slice to open those files.
.safetensors369 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of base_model on an FRIENDS TV Series dataset. Fine-tuning was done by taking only the parts of the dataset where Monica spoke.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig
base_model = "mistralai/Mistral-7B-Instruct-v0.2"
adapter_model = "akingunduz/monica_llm"
model = AutoModelForCausalLM.from_pretrained(base_model)
model = PeftModel.from_pretrained(model, adapter_model)
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = model.to("cuda")
model.eval()
import torch
def build_prompt(question):
prompt=f"<s>[INST]@Monica. {question} [/INST]"
return prompt
question = "Which city do you live?"
prompt = build_prompt(question)
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(input_ids=inputs["input_ids"].to("cuda"), max_new_tokens=10)
print(tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0])
>>> [INST]@Monica. Which city do you live? [/INST]New York.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).