Downloads · 30 days
43
18% of all-time downloads
522H0134-NguyenNhatHuy/Vinallama-2.7b-chat-SFT
Vinallama-2.7b-chat-SFT is a text generation model from 522H0134-NguyenNhatHuy. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This model is a fine-tuned version of viet-mistral/vinallama-2.7b-chat using LoRA + PEFT, targeting Vietnamese open-domain, instruction-following chat. It is aligned for safe, helpful, and fluent conversations in Viet…
Downloads · 30 days
43
18% of all-time downloads
All-time downloads
234
Public
Repo size
100 MB
Likes
0
Public
Click a slice to open those files.
.safetensors100 MB · 95%
From the Hugging Face model README
This model is a fine-tuned version of viet-mistral/vinallama-2.7b-chat using LoRA + PEFT, targeting Vietnamese open-domain, instruction-following chat. It is aligned for safe, helpful, and fluent conversations in Vietnamese through supervised fine-tuning on high-quality prompt-response pairs.
The model was evaluated on a Vietnamese test set of 1,000 prompts (60% safe / 40% adversarial) adapted from JailBreak, HarmBench, and OpenAssistant.
Detoxify was used to filter harmful generations during evaluation.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model and LoRA adapter
tokenizer = AutoTokenizer.from_pretrained("viet-mistral/vinallama-2.7b-chat")
base_model = AutoModelForCausalLM.from_pretrained("viet-mistral/vinallama-2.7b-chat")
model = PeftModel.from_pretrained(base_model, "522H0134-NguyenNhatHuy/Vinallama-2.7b-chat-SFT")
# Chat example
prompt = "Xin chào, bạn có thể giúp tôi học tiếng Anh không?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))