Downloads · 30 days
0
Andth/qwen2.5-3b-vi-lab21-r16
qwen2.5-3b-vi-lab21-r16 is a machine learning model from Andth. 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 transformers. The card lists the license as apache-2.0.
Fine-tuned LoRA adapter cho Qwen2.5-3B trên Vietnamese instruction-following dataset, sử dụng QLoRA 4-bit + Unsloth. Đây là submission cho Lab 21 — AICB-P2T3.
Downloads · 30 days
0
Access
Public
Updated May 7, 2026
Repo size
26.2 MB
Likes
0
Public
Click a slice to open those files.
.safetensors14.8 MB · 56%
From the Hugging Face model README
Fine-tuned LoRA adapter cho Qwen2.5-3B trên Vietnamese instruction-following dataset, sử dụng QLoRA 4-bit + Unsloth. Đây là submission cho Lab 21 — AICB-P2T3.
unsloth/Qwen2.5-3B-bnb-4bit (Qwen2.5, 3B parameters, NF4 4-bit quantized)q_proj, v_proj5CD-AI/Vietnamese-alpaca-gpt4-gg-translatedinstruction_vi / input_vi / output_vi)| Parameter | Value |
|---|---|
| Rank (r) | 16 |
| Alpha | 32 |
| Dropout | 0 |
| Epochs | 3 |
| Learning rate | 2e-4 |
| LR schedule | Cosine |
| Warmup ratio | 0.10 |
| Batch size (effective) | 8 (1 × grad_accum 8) |
| Optimizer | AdamW 8-bit (paged) |
| Gradient checkpointing | ✅ Unsloth mode |
| Quantization | NF4 4-bit (QLoRA) |
| GPU | Tesla T4 (15.6 GB VRAM) |
| CUDA | 12.8 |
| PyTorch | 2.10.0 |
| Unsloth | 2026.5.2 |
| TRL | 0.15.2 |
| Transformers | 5.5.0 |
| Training time | ~3.9 min |
| Peak VRAM | 6.62 GB |
| Estimated cost | ~$0.02 |
| Metric | Value |
|---|---|
| Eval Loss | 1.5161 |
| Perplexity | 4.554 |
| Rank | Trainable Params | Peak VRAM | Eval Loss | Perplexity |
|---|---|---|---|---|
| r=8 | 1,843,200 | 7.21 GB | 1.5577 | 4.748 |
| r=16 | 3,686,400 | 6.62 GB | 1.5161 | 4.554 |
| r=64 | 14,745,600 | 8.00 GB | 1.4768 | 4.379 |
r=16 cho ROI tốt nhất: cải thiện rõ so với r=8, trong khi VRAM thấp hơn r=64 và params chỉ bằng 1/4.
from unsloth import FastLanguageModel
from peft import PeftModel
# Load base model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/Qwen2.5-3B-bnb-4bit",
max_seq_length=1024,
load_in_4bit=True,
)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, "Andth/qwen2.5-3b-vi-lab21-r16")
FastLanguageModel.for_inference(model)
# Generate
prompt = """### Instruction:
Giải thích khái niệm machine learning cho người mới bắt đầu.
### Response:
"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))