Spaces:
Sleeping
Sleeping
| 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) |