所有语言版本中的命令和代码均保持英文。请将大写占位符替换为您账户和付费作业中的实际值;请勿将真实密钥粘贴到共享笔记本或日志中。
构建完整训练方案
- 任务 语言或业务目标
- 输入 训练集、验证集和隐藏测试集
- 运行环境 兼容的计算资源与存储
- 结果 验收标准与有效输出
任务: 语言或业务目标. 输入: 训练集、验证集和隐藏测试集. 运行环境: 兼容的计算资源与存储. 结果: 验收标准与有效输出
训练可独立运行的德语模型
从配置章节中的完整自动模式配置开始。创建项目目录,放入兼容的学生模型、经过审核的训练材料、独立验证集和最终测试集,以及德语评估标准。选择服务商方案中包含的 reference model。SDK 应提出先决条件和主题,建立基线,并在获准预算内改进模型。
- 下方 JSON 用英文展示数据格式;请将实际审核过的德语文本放入真实数据文件,每行一个对象。
- 可运行的项目文件必须使用完整自动模式配置,不能只用方案片段。
- 分别衡量理解、写作、翻译和推理能力。不能保证小型学生模型在每项任务上都达到教师模型的水平。
{"text":"Customer: My invoice total is incorrect. Category: billing"}
{"text":"Customer: I cannot sign in. Category: account_access"}
{"text":"Customer: The application closes when I upload a file. Category: technical_issue"}
# Full Automatic German-language workflow.
# 1. Put a compatible local model in german-project/models/student/.
# 2. Save the complete project configuration as german-project/training.json.
# 3. Add independent train/validation/test files and the reviewed german rubric.
# 4. Replace provider/reference placeholders using your included model catalogue.
fpai-training doctor --config ./german-project/training.json
fpai-training plan --config ./german-project/training.json --dry-run
# The plan must break the objective into prerequisites and measurable topics.
fpai-training run --config ./german-project/training.json
fpai-training evaluate --run ./german-project/runs/german-001 --split test
fpai-training export --run ./german-project/runs/german-001 --format safetensors
# Evaluate comprehension, writing, translation and reasoning separately.
# A passed classifier does not prove all German-language capabilities.
将项目调整为业务任务
以下 JSON 示例是配置片段,不是完整项目文件。复制完整的自动或高级配置,用片段替换指定部分;保留身份信息、模型、教师模型、运行环境和有限预算,然后验证完整文件。分类和翻译需要不同的主题、数据与验收标准。
- 对于客服分类,应报告各类别的 precision 和 recall、macro F1、类别分布以及易混淆案例。
- 对于翻译,应使用独立的双语示例检查含义、术语、人名、数字和语气。
- 当
teacher_sharing为none时,客户记录会留在本地。如果不允许共享的数据不足以实现目标,应停止并说明原因,而不是上传数据。
{
"schema_version": "1.0", "mode": "automatic",
"objective": "Classify support messages into billing, account_access or technical_issue.",
"model": {"path": "./models/student", "adapter": "transformers-causal-lm", "revision": null},
"teacher": {"provider": "openai", "reference_model_id": 123},
"data": {"sources": ["./data/train.jsonl"], "teacher_sharing": "none", "validation_path": "./data/validation.jsonl", "test_path": "./data/test.jsonl", "deduplicate": true, "seed": 42},
"runtime": {"target": "customer_datacenter", "devices": "auto", "distributed": {"backend": "none", "nodes": 1}},
"training": {"method": "auto"},
"curriculum": {"topics": ["intent", "ambiguous_requests", "class_balance"], "max_improvement_cycles": 3, "stop_on_regression": true},
"budgets": {"max_training_minutes": 120, "max_teacher_requests": 100, "max_storage_gib": 20},
"checkpoints": {"every_steps": 100, "keep_last": 3, "resume_validation": "strict"},
"evaluation": {"rubric": "./rubric.json", "baseline_required": true},
"output": {"directory": "./runs/support-001", "format": "adapters"}
}
{
"objective": "Translate English support replies into German while preserving names, numbers and meaning.",
"curriculum": {"topics": ["terminology", "meaning", "names_and_numbers", "tone"], "max_improvement_cycles": 3, "stop_on_regression": true},
"evaluation": {"rubric": "./rubrics/translation.json", "baseline_required": true},
"data": {"sources": ["./data/translation-train.jsonl"], "validation_path": "./data/translation-validation.jsonl", "test_path": "./data/translation-test.jsonl", "teacher_sharing": "approved_only"},
"output": {"directory": "./runs/translation-001", "format": "safetensors"}
}
{"prompt":"My invoice total is wrong. Which category applies?","target":"billing","criterion":"support_category"}
{"prompt":"I cannot sign in. Which category applies?","target":"account_access","criterion":"support_category"}
{
"schema_version": "1.0",
"name": "support-category-evaluation",
"scale": {"minimum": 0, "maximum": 1},
"criteria": [
{"id": "support_category", "description": "Match the expected category.", "metric": "macro_f1", "minimum_score": 0.85}
],
"regression": {"maximum_score_drop": 0.02},
"final_test": {"path": "./data/test.jsonl", "allow_training_use": false}
}
选择合适的基础设施并安全交付
这些运行环境示例也是完整审核配置中的片段。FusionPointAI Hosting、客户数据中心和兼容的 Colab 运行环境可提供计算资源;选择某个名称并不会分配 GPU、购买 notebook 点数,也不会使其他运行环境自动兼容。SDK 会在该运行环境中加载并训练学生模型。临时 notebook 结束前请保存输出。
- 托管示例:使用合同约定的计算环境、获批存储和账户权益;在适用情况下,托管属于单独的商业项目。
- Colab 示例:将 API key 保存在 notebook 的机密信息存储中,检查可用 GPU 和存储,并在运行终止前将有效检查点复制到获批的持久存储。
- 分布式示例:使用获准的协调器和经过身份验证的节点通信,确保环境固定且 rendezvous/rank 值一致。launcher 只能管理本项目的 worker。
{
"runtime": {"target": "fusionpointai_hosting", "devices": "auto", "distributed": {"backend": "none", "nodes": 1}},
"budgets": {"max_training_minutes": 60, "max_teacher_requests": 500, "max_storage_gib": 20},
"output": {"directory": "./runs/hosted-001", "format": "safetensors"}
}
{
"runtime": {"target": "colab", "devices": [0], "distributed": {"backend": "none", "nodes": 1}},
"checkpoints": {"every_steps": 50, "keep_last": 2, "resume_validation": "strict"},
"budgets": {"max_training_minutes": 30, "max_teacher_requests": 100, "max_storage_gib": 10},
"output": {"directory": "./runs/colab-001", "format": "adapters"}
}
{
"runtime": {"target": "customer_datacenter", "devices": [0, 1], "distributed": {"backend": "ddp", "nodes": 2}},
"checkpoints": {"every_steps": 100, "keep_last": 3, "resume_validation": "strict"},
"output": {"directory": "./runs/distributed-001", "format": "safetensors"}
}
# Export a validated adapter or full model, not teacher weights.
fpai-training evaluate --run ./german-project/runs/support-001 --split test
fpai-training export --run ./german-project/runs/support-001 --format adapters
# Inspect artifact-manifest.json, pinned base/tokenizer and evaluation-report.json.
# Reload the package in a fresh compatible runtime before changing live inference.
# Export does not deploy, allocate hosting, or upload to an external model hub.