Spaces:
Build error
Build error
File size: 395 Bytes
3ac4614 | 1 2 3 4 5 6 7 8 9 10 11 12 | from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "mistralai/Mistral-7B-v0.1"
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, "your-username/mistral-finetuned-model")
tokenizer = AutoTokenizer.from_pretrained(base_model) |