Instructions to use Marvis12957/ai_in_action_lab21 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Marvis12957/ai_in_action_lab21 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3.5-4B") model = PeftModel.from_pretrained(base_model, "Marvis12957/ai_in_action_lab21") - Notebooks
- Google Colab
- Kaggle
ai_in_action_lab21 — LoRA adapter (cấu hình đúng)
LoRA adapter fine-tune từ unsloth/Qwen3.5-4B để phân loại ticket chăm sóc khách hàng
tiếng Việt thành JSON triage (intent, urgency, product, sentiment). Bài lab 21 —
Fine-tuning LLMs (LoRA/QLoRA).
Tác giả: Trần Văn Hiếu · MSSV 2A202602030
Cấu hình huấn luyện
| Hạng mục | Giá trị |
|---|---|
| Base model | unsloth/Qwen3.5-4B |
| Vị trí LoRA | text-linear (12 module) |
| Rank (r) | 16 |
| Trainable params | 32,464,896 |
| Learning rate | 1e-4 |
| Epochs / steps | 2 / 30 |
| Train / val | 225 / 25 mẫu (seed 42) |
| Precision | 16-bit |
Kết quả đánh giá (n = 50 mẫu target)
| Metric | Giá trị |
|---|---|
| target accuracy | 0.965 |
| format validity | 1.000 |
| latency | 1454.5 ms |
| regression (năng lực chung) | 0.4556 (base: 0.7578) |
Cảnh báo trước khi dùng
Adapter này trượt cổng hồi quy: điểm regression (đo năng lực trả lời câu hỏi phổ thông ngoài phạm vi triage) rơi từ 0.7578 xuống 0.4556 sau fine-tune — mất 0.3022 điểm, gấp hơn 15 lần tolerance 0.020. Model giỏi sinh JSON triage nhưng đã mất gần 40% năng lực chung, nên không nên dùng làm assistant tổng quát. Khuyến nghị: chỉ gọi adapter này sau một bước router đã xác định đúng đây là ticket CSKH, hoặc trộn thêm dữ liệu phổ thông vào tập train rồi huấn luyện lại.
Cách nạp
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE = "unsloth/Qwen3.5-4B"
tok = AutoTokenizer.from_pretrained(BASE)
model = AutoModelForCausalLM.from_pretrained(BASE, device_map="auto")
model = PeftModel.from_pretrained(model, "Marvis12957/ai_in_action_lab21")
Chi tiết đầy đủ (baseline, đối chứng cấu hình sai, phân tích định tính) trong báo cáo lab.
- Downloads last month
- 10