chat_sft.py (SFT 微调)
# SFT 训练脚本
python -m scripts.chat_sft \
--pretrained_path ./runs/speedrun/checkpoint.pt \
--dataset alpaca \
--lr 1e-5 \
--epochs 3
```
**数据处理**:
```python
# Alpaca 格式
{
"instruction": "What is the capital of France?",
"input": "",
"output": "Paris"
}
# 转换为对话格式
messages = [
{"role": "user", "content": "What is the capital of France?"},
{"role": "assistant", "content": "Paris"}
]