Downloads · 30 days
9
6% of all-time downloads
TESTtm7873/MistralCat-1v
MistralCat-1v is a machine learning model from TESTtm7873. 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.
Downloads · 30 days
9
6% of all-time downloads
All-time downloads
156
Public
Repo size
1 GB
Likes
2
Public
Click a slice to open those files.
.safetensors1.7 GB · 83%
From the Hugging Face model README
MIT License
This model is part of the VCC project and has been fine-tuned on the TESTtm7873/ChatCat dataset using the mistralai/Mistral-7B-Instruct-v0.2 as the base model. The fine-tuning process utilized QLoRA for improved performance.
To use this model, you'll need to set up your environment first:
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistral-7B-Instruct-v0.2",
load_in_8bit=True,
device_map="auto",
)
model = PeftModel.from_pretrained(model, "TESTtm7873/MistralCat-1v")
model.eval()
def evaluate(question: str) -> str:
prompt = f"The conversation between human and Virtual Cat Companion.\n[|Human|] {question}.\n[|AI|] "
inputs = tokenizer(prompt, return_tensors="pt")
input_ids = inputs["input_ids"].cuda()
generation_output = model.generate(
input_ids=input_ids,
generation_config=generation_config,
return_dict_in_generate=True,
output_scores=True,
max_new_tokens=256
)
output = tokenizer.decode(generation_output.sequences[0]).split("[|AI|]")[1]
return output
your_question: str = "You have the softest fur."
print(evaluate(your_question))