vochris commited on
Commit
43c8a98
·
verified ·
1 Parent(s): ed93a5f

Add model card

Browse files
Files changed (1) hide show
  1. README.md +87 -0
README.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - vi
4
+ - en
5
+ license: apache-2.0
6
+ base_model: Qwen/Qwen2.5-3B-Instruct
7
+ tags:
8
+ - vietnamese
9
+ - english
10
+ - customer-support
11
+ - instruction-tuning
12
+ - lora
13
+ - unsloth
14
+ pipeline_tag: text-generation
15
+ ---
16
+
17
+ # qwen2.5-3b-viet-customer-support-lora
18
+
19
+ Vietnamese-first bilingual customer support LoRA adapter fine-tuned from **Qwen2.5-3B-Instruct** with Unsloth.
20
+
21
+ ## What this model is for
22
+ - Vietnamese customer support conversations
23
+ - English fallback responses
24
+ - Polite, concise, next-step-oriented support messaging
25
+
26
+ ## Base model
27
+ - `Qwen/Qwen2.5-3B-Instruct`
28
+
29
+ ## Training data (high-level)
30
+ - OPUS-100 EN↔VI parallel pairs (filtered)
31
+ - Synthetic customer support instruction examples (order status, refunds, shipping delays, account issues, billing)
32
+ - Final split: **176k train / 4k eval**
33
+
34
+ ## Training setup
35
+ - Framework: Unsloth + TRL SFTTrainer
36
+ - Precision: bf16
37
+ - Quantization for training: 4-bit base model
38
+ - LoRA: r=32, alpha=64, dropout=0.0
39
+ - Max seq len: 768
40
+
41
+ ## Prompt format
42
+ ```text
43
+ Instruction:
44
+ {instruction}
45
+
46
+ User:
47
+ {input}
48
+
49
+ Assistant:
50
+ ```
51
+
52
+ ## Quick usage (PEFT)
53
+ ```python
54
+ from transformers import AutoModelForCausalLM, AutoTokenizer
55
+ from peft import PeftModel
56
+ import torch
57
+
58
+ base = "Qwen/Qwen2.5-3B-Instruct"
59
+ adapter = "REPLACE_WITH_HF_REPO"
60
+
61
+ tok = AutoTokenizer.from_pretrained(base)
62
+ model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="auto")
63
+ model = PeftModel.from_pretrained(model, adapter)
64
+
65
+ prompt = """Instruction:
66
+ Bạn là nhân viên chăm sóc khách hàng tiếng Việt. Trả lời lịch sự, đồng cảm, và nêu bước tiếp theo rõ ràng.
67
+
68
+ User:
69
+ Xin chào, đơn hàng của tôi bị trễ 5 ngày. Mã đơn #A12345.
70
+
71
+ Assistant:
72
+ """
73
+
74
+ inputs = tok(prompt, return_tensors="pt").to(model.device)
75
+ out = model.generate(**inputs, max_new_tokens=180, temperature=0.3, do_sample=True)
76
+ print(tok.decode(out[0], skip_special_tokens=True))
77
+ ```
78
+
79
+ ## Limitations
80
+ - Not a legal/compliance authority
81
+ - Can still hallucinate policy details if product policy is ambiguous
82
+ - Should be paired with retrieval or hard policy checks in production
83
+
84
+ ## Recommended production guardrails
85
+ - Ground responses on your real policy KB
86
+ - Enforce redaction/PII handling
87
+ - Add escalation rules for sensitive requests