以下命令均从仓库根目录运行。项目要求 Python >=3.13。
bash
uv sync
trio login
swanlab login1. 下载数据
bash
uv run python 07-gspo/prepare_data.py这条命令会准备 DAPO-Math 训练集和 AIME25 评测集。
2. 启动训练
bash
uv run python 07-gspo/train.py \
--max-steps 100 \
--groups-per-step 8 \
--group-size 8 \
--max-prompt-tokens 2048 \
--max-tokens 4096 \
--save-every 20 \
--swanlab-mode online训练日志会打印可续训的 state 路径和用于采样、评测的 sampler weights 路径。
3. 运行评测
先评测 Base Model:
bash
uv run python 07-gspo/eval.py再评测训练得到的 sampler weights:
bash
uv run python 07-gspo/eval.py \
--model-path 'trio://RUN_ID/sampler_weights/GSPO_WEIGHTS_NAME' \
--output 07-gspo/eval-results/aime25-gspo-step100.jsonl