Downloads · 30 days
2
4% of all-time downloads
hieuhieu3603/lab21-qwen2.5-3b-r16
lab21-qwen2.5-3b-r16 is a machine learning model from hieuhieu3603. 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 peft. The card lists the license as apache-2.0.
Author: Nguyễn Đoàn Hiếu (2A202600144) Course: AICB-P2T3 · VinUniversity Date: 2026-05-07
Downloads · 30 days
2
4% of all-time downloads
All-time downloads
53
Public
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
Author: Nguyễn Đoàn Hiếu (2A202600144) Course: AICB-P2T3 · VinUniversity Date: 2026-05-07
LoRA adapter fine-tuned trên Qwen2.5-3B (4-bit quantized) với dataset Vietnamese Alpaca. Đây là bài Lab 21 về LoRA/QLoRA Fine-tuning.
unsloth/Qwen2.5-3B-bnb-4bitq_proj, v_proj5CD-AI/Vietnamese-alpaca-gpt4-gg-translated (200 samples)| Parameter | Value |
|---|---|
| Epochs | 3 |
| Learning rate | 2e-4 |
| LR schedule | Cosine |
| Warmup ratio | 0.10 |
| Optimizer | adamw_8bit |
| Effective batch size | 8 (1 × grad_accum=8) |
| Max seq length | 1024 |
| Rank | Trainable Params | Eval Loss | Perplexity |
|---|---|---|---|
| 8 | 1,843,200 | 1.5577 | 4.75 |
| 16 | 3,686,400 | 1.5161 | 4.55 |
| 64 | 14,745,600 | 1.4768 | 4.38 |
from peft import PeftModel
from unsloth import FastLanguageModel
# Load base + adapter
model, tokenizer = FastLanguageModel.from_pretrained(
"unsloth/Qwen2.5-3B-bnb-4bit",
max_seq_length=1024,
load_in_4bit=True,
)
model = PeftModel.from_pretrained(model, "hieuhieu3603/lab21-qwen2.5-3b-r16")
# Generate
FastLanguageModel.for_inference(model)
prompt = "### Instruction:\nGiải thích machine learning cho người mới.\n\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
print(tokenizer.decode(output[0], skip_special_tokens=True))