--- library_name: peft base_model: mistralai/Mistral-7B-Instruct-v0.2 language: - en --- # Model Card for Model ID This model is a fine-tuned version of [base_model](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) on an [FRIENDS TV Series](https://www.kaggle.com/datasets/blessondensil294/friends-tv-series-screenplay-script) dataset. Fine-tuning was done by taking only the parts of the dataset where Monica spoke. ## Uses ```python 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"[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](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). - PEFT 0.10.0