Edit model card

Model Card for Model ID

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.

Uses

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.

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • PEFT 0.10.0
Downloads last month
0
Unable to determine this model’s pipeline type. Check the docs .

Adapter for