devon-ai commited on
Commit
8d3549a
·
verified ·
1 Parent(s): 7d82f00

Upload training_config.yaml with huggingface_hub

Browse files
Files changed (1) hide show
  1. training_config.yaml +67 -0
training_config.yaml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dev0.1 訓練設定(YAML)
2
+ # ============================================================
3
+ # 目標:在 Qwen2.5-3B-Instruct 基礎上,以 LoRA 內化 DevonAI 的
4
+ # 工具呼叫協定({"tool": ..., "args": {...}})與簡短思考習慣。
5
+
6
+ project:
7
+ name: "dev0.1"
8
+ output_dir: "training/output/dev0.1-lora"
9
+ merged_dir: "training/output/dev0.1-hf"
10
+ gguf_dir: "models"
11
+ gguf_name: "dev0.1-q4_k_m.gguf"
12
+
13
+ # 基座模型(Hugging Face ID 或本機路徑)
14
+ base_model: "Qwen/Qwen2.5-3B-Instruct"
15
+
16
+ # 資料
17
+ data:
18
+ train_file: "training/dataset/dev0.1_train.jsonl"
19
+ val_file: "training/dataset/dev0.1_val.jsonl"
20
+ max_seq_length: 2048
21
+ # LoRA 設定(3B 於 12GB VRAM 可跑;16GB+ 可把 r 提高到 32)
22
+ lora:
23
+ r: 16
24
+ alpha: 16
25
+ dropout: 0.05
26
+ bias: "none"
27
+ target_modules:
28
+ - "q_proj"
29
+ - "k_proj"
30
+ - "v_proj"
31
+ - "o_proj"
32
+ - "gate_proj"
33
+ - "up_proj"
34
+ - "down_proj"
35
+
36
+ # 訓練超參數
37
+ training:
38
+ backend: "auto" # auto | unsloth | peft(自動偵測 unsloth 是否安裝)
39
+ epochs: 3
40
+ per_device_batch_size: 2
41
+ gradient_accumulation_steps: 8 # 有效 batch = 16(16GB VRAM 可用;12GB 改 1+16)
42
+ learning_rate: 0.0002 # 2e-4,LoRA 常用區間 1e-4~3e-4
43
+ warmup_steps: 10 # trl>=1.17 以步數取代 warmup_ratio
44
+ lr_scheduler: "cosine"
45
+ weight_decay: 0.01
46
+ max_grad_norm: 1.0
47
+ logging_steps: 10
48
+ save_steps: 200
49
+ eval_steps: 100
50
+ seed: 42
51
+ gradient_checkpointing: true # 省顯存;unsloth 下會自動啟用 optimized 版本
52
+ packing: false # 開啟可加速但樣本較長時需注意
53
+ max_steps: -1 # -1 = 跑完整 epochs(smoke 時改為小數值)
54
+
55
+ # 量化(GGUF 轉換)
56
+ quantization:
57
+ type: "Q4_K_M"
58
+ llama_cpp_dir: "third_party/llama.cpp" # 不存在時自動 clone
59
+
60
+ # 評估
61
+ eval:
62
+ samples: 30 # 生成樣本數(工具呼叫合法率評估)
63
+ temperature: 0.2 # 貼近實戰的確定性輸出
64
+ max_new_tokens: 256
65
+ pass_criteria: # 合格線(未達標請增加資料或 epochs)
66
+ tool_call_valid_rate: 0.9 # 工具呼叫 JSON 合法率 ≥ 90%
67
+ plain_reply_rate: 0.85 # 純對話樣本不亂呼叫工具的比例 ≥ 85%