Downloads · 30 days
0
nkuniyil/mistral-7b-sft
mistral-7b-sft is a machine learning model from nkuniyil. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a LoRA adapter for Mistral-7B trained using Supervised Fine-Tuning (SFT) on the Alpaca-GPT4 dataset.
Downloads · 30 days
0
Access
Public
Updated Jan 31, 2026
Repo size
328 MB
Likes
0
Public
Click a slice to open those files.
.pt219 MB · 56%
From the Hugging Face model README
This is a LoRA adapter for Mistral-7B trained using Supervised Fine-Tuning (SFT) on the Alpaca-GPT4 dataset.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "nkuniyil/mistral-7b-sft")
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("nkuniyil/mistral-7b-sft")
# Generate
prompt = "### Instruction:\nWrite a haiku about AI.\n\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))
This model is part of a study comparing Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO).
See also: