-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
当你想从一个新 checkout 快速验证 DomainPostTrain 是否能跑通时,使用本页。
快速自检只验证链路是否可用,不代表已经完成真实模型训练。真实训练仍需要替换数据、配置基础模型、准备 GPU 和检查输出质量。
- 与所选 PyTorch 构建兼容的 Python 环境。
- 主仓库已经 clone 到本地。
- 如果运行 smoke test 或训练,需要为
outputs/预留磁盘空间。 - 真实训练需要 CUDA GPU。CPU 只适合做链路 smoke test。
Linux/macOS:
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtWindows PowerShell:
py -3.10 -m venv .venv
& .\.venv\Scripts\python.exe -m pip install --upgrade pip
& .\.venv\Scripts\python.exe -m pip install -r requirements.txt预期结果:环境中包含 PyTorch、Transformers、Datasets、PEFT、TRL、Flask 和默认流水线依赖。
cp configs/domain_post_training.yaml configs/my_domain.yamlWindows PowerShell:
Copy-Item configs/domain_post_training.yaml configs/my_domain.yaml优先编辑复制出来的文件。保留 configs/domain_post_training.yaml 作为基线示例。
python scripts/training/train_pipeline.py --config configs/domain_post_training.yaml --smoke_test --device cpu预期结果:
- 在
outputs/smoke/base_model下创建极小 smoke model。 - 覆盖数据准备、PEFT adapter 保存、adapter merge 和报告生成链路。
- 不下载默认基础模型。
python -m compileall pipeline scripts serve_inference.py预期结果:Python 文件没有语法错误。这个检查不证明 GPU 训练依赖已经安装完成。
Use this page when you want the shortest path from a fresh checkout to a verified DomainPostTrain setup.
The quick smoke path verifies wiring only. It does not mean a real model has been trained. Real training still requires replacing data, configuring the base model, preparing GPU resources, and checking output quality.
- A Python environment compatible with the chosen PyTorch build.
- A local checkout of the main repository.
- Enough disk space for
outputs/if you run smoke tests or training. - A CUDA GPU for real training. CPU is only practical for smoke wiring.
Linux/macOS:
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtWindows PowerShell:
py -3.10 -m venv .venv
& .\.venv\Scripts\python.exe -m pip install --upgrade pip
& .\.venv\Scripts\python.exe -m pip install -r requirements.txtExpected result: the environment contains PyTorch, Transformers, Datasets, PEFT, TRL, Flask, and the other default pipeline dependencies.
cp configs/domain_post_training.yaml configs/my_domain.yamlWindows PowerShell:
Copy-Item configs/domain_post_training.yaml configs/my_domain.yamlEdit the copy first. Keep configs/domain_post_training.yaml as the baseline example.
python scripts/training/train_pipeline.py --config configs/domain_post_training.yaml --smoke_test --device cpuExpected result:
- A tiny smoke model is created under
outputs/smoke/base_model. - Dataset preparation, PEFT adapter saving, adapter merge, and report generation are exercised.
- The command does not download the default base model.
python -m compileall pipeline scripts serve_inference.pyExpected result: Python files compile without syntax errors. This does not prove that GPU training dependencies are installed.
- Replace the mock data: Data Contracts
- Check the training environment and base model: Operations Runbook
- Change paths or training settings: Configuration
- Run the full training workflow: Training Pipeline
- Diagnose failures: Troubleshooting