CoolFace
Modelpublic

traffic-legal-lm/round1-lora

sourceHugging Facellama3updated 4mo agoView on Hugging Face
0likes10downloads
Model Card

Round 1 LoRA — Traffic Legal LM

第一輪 LoRA 微調,使用 traffic_law_round1(初版小規模資料集)對 yentinglin/Llama-3-Taiwan-8B-Instruct-rc2 進行微調,主要用於驗證 LLaMA-Factory 訓練流程。後續 Round 2 的兩個模型 (round2-sonnet46-lora / round2-gpt4o-baseline-lora)已取代本模型作為正式比較對象。

訓練設定

  • —Base model: yentinglin/Llama-3-Taiwan-8B-Instruct-rc2
  • —Dataset: traffic_law_round1
  • —Method: LoRA, lora_target=all, rank=16, alpha=32, dropout=0.05
  • —Batch size: perdevice=4, gradaccum=2(有效 batch=8)
  • —Epochs: 3, lr=2e-4 (cosine, warmup 10%), bf16

訓練結果

  • —train_loss: 0.145(無 eval set)

使用方式

python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "yentinglin/Llama-3-Taiwan-8B-Instruct-rc2"
adapter_id = "traffic-legal-lm/round1-lora"

tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)

更完整的處理流程、資料集與評估說明請見專案 repo: Traffic_Legal_LM