feat: update skill

This commit is contained in:
故璃
2026-07-09 20:18:48 +08:00
parent 19f5746dc0
commit dcc7921ebf
8 changed files with 51 additions and 54 deletions
+8 -8
View File
@@ -10,9 +10,9 @@ Tell your agent "train a model" or "deploy my fine-tuned model on Bailian," and
1. **Pre-check** — verify auth (`bl auth status`) and query training capabilities (`bl finetune capability`) to pick a supported base model and training type
2. **Prepare data** — local file, an already-uploaded dataset, or a generated sample; validate with `bl dataset validate` before submitting
3. **Create the fine-tune job** — `bl finetune create` with the right `--training-type` (`sft-lora` / `sft` / `dpo` / `cpt`) and sensible hyperparameters. Audio TTS uses `sft-lora` → `efficient_sft` with auto-injected audio hyperparams. Image generation also uses `sft-lora` with auto-injected Wan2.x hyperparams (max_steps, lora_rank, etc.)
3. **Create the fine-tune job** — `bl finetune <modality> create` with the right `--training-type` (`sft-lora` / `sft` / `dpo` / `cpt`) and sensible hyperparameters. Audio TTS uses `sft-lora` → `efficient_sft` with auto-injected audio hyperparams. Image generation also uses `sft-lora` with auto-injected Wan2.x hyperparams (max_steps, lora_rank, etc.)
4. **Wait asynchronously** — poll training status via a Monitor script (non-blocking), exit on `SUCCEEDED` / `FAILED` / `CANCELED`
5. **Deploy** — `bl deploy create` to turn the fine-tuned (or base) model into a dedicated inference instance
5. **Deploy** — `bl deploy <modality> create` to turn the fine-tuned (or base) model into a dedicated inference instance
6. **Wait for ready** — poll deployment status until `RUNNING`
7. **Hand off** — a ready-to-run example: `bl text chat` for text models, `bl speech synthesize --voice default` for audio TTS, async API + trigger word for image generation
@@ -43,7 +43,7 @@ Tell your agent "train a model" or "deploy my fine-tuned model on Bailian," and
## Safety guardrails
`bl finetune create` and `bl deploy create` are real write operations that create billable resources. `bl` has **no `--dry-run`**, so the skill substitutes real pre-checks + a billing gate:
`bl finetune <modality> create` and `bl deploy <modality> create` are real write operations that create billable resources. `bl` has **no `--dry-run`**, so the skill substitutes real pre-checks + a billing gate:
1. **Pre-checks instead of dry-run** — `bl finetune capability --model <base>` (training support), `bl deploy models --source custom|base` (deployable + available plans), `bl deploy list --status RUNNING` (reuse an existing deployment of the same model instead of creating a second billable instance).
2. **Billing gate on `mu`/`ptu`** — `lora` (token-billed, idle usually free) is the safe default; `mu`/`ptu` are reserved resources that bill even when idle, so the skill **asks the user for explicit confirmation before creating them** and never auto-approves reserved resources with `--yes` in non-interactive (agent/CI) contexts.
@@ -68,10 +68,10 @@ The skill walks the two-link pipeline, polling at the two wait points via Monito
```
Link A (train then deploy):
dataset → finetune create → wait SUCCEEDED → (auto-export) → deploy create → wait RUNNING → text chat
dataset → finetune <modality> create → wait SUCCEEDED → (auto-export) → deploy <modality> create → wait RUNNING → text chat
Link B (deploy base, skip training):
base model → deploy create → wait RUNNING → text chat
base model → deploy <modality> create → wait RUNNING → text chat
```
It captures the right IDs at each step (`job_id` / `finetuned_output` → `deployed_model`) and steers around the common pitfalls (e.g. calling the fine-tuned model by its `qwen3-8b-ft-...` name returns 404 — you must deploy first and call the `deployed_model` instance id).
@@ -83,15 +83,15 @@ User request
→ Pre-check auth + training capability (listFoundationModels via API key)
→ Modality dispatch: text → text.md | audio TTS → audio.md | image → image.md
→ Prepare & validate dataset (text .jsonl / audio .zip / image .zip)
→ finetune create (sft-lora default; CLI value → server field; audio/image hyperparams auto-injected)
→ finetune <modality> create (sft-lora default; CLI value → server field; audio/image hyperparams auto-injected)
→ Monitor wait.sh finetune <JOB_ID> (30s poll, async)
→ Auto-export best checkpoint (usually skip manual export)
→ deploy create (pick plan by model source + modality: text ft → lora/mu, audio TTS → mu, image → lora)
→ deploy <modality> create (pick plan by model source + modality: text ft → lora/mu, audio TTS → mu, image → lora)
→ Monitor wait.sh deploy <DEPLOYED_MODEL> (15s poll, async)
→ Call: text → text chat | audio TTS → speech synthesize | image → async API + trigger word
```
The skill encodes the full orchestration plus the gotchas (zsh `status` is read-only, `--model` means different things in `deploy create` vs inference commands, state-propagation 404 right after `RUNNING`, idle-billing differences between `lora` / `mu` / `ptu`, audio TTS only supports `mu` plan, image generation only supports `lora` plan, image prompt requires trigger word) so the agent doesn't have to rediscover them.
The skill encodes the full orchestration plus the gotchas (zsh `status` is read-only, `--model` means different things in `deploy <modality> create` vs inference commands, state-propagation 404 right after `RUNNING`, idle-billing differences between `lora` / `mu` / `ptu`, audio TTS only supports `mu` plan, image generation only supports `lora` plan, image prompt requires trigger word) so the agent doesn't have to rediscover them.
## Modality extension architecture
+8 -8
View File
@@ -10,9 +10,9 @@
1. **前置检查** —— 验证认证(`bl auth status`)、查询训练能力(`bl finetune capability`),选定支持的基座与训练类型
2. **准备数据** —— 本地文件、已上传数据集或生成示例数据;提交前用 `bl dataset validate` 校验通过
3. **创建微调任务** —— `bl finetune create`,选对 `--training-type`(`sft-lora` / `sft` / `dpo` / `cpt`)与合理超参
3. **创建微调任务** —— `bl finetune <模态> create`,选对 `--training-type`(`sft-lora` / `sft` / `dpo` / `cpt`)与合理超参
4. **异步等待** —— 用 Monitor 脚本轮询训练状态(不阻塞),到 `SUCCEEDED` / `FAILED` / `CANCELED` 终态退出
5. **创建部署** —— `bl deploy create`,把微调(或基座)模型变成专属推理实例
5. **创建部署** —— `bl deploy <模态> create`,把微调(或基座)模型变成专属推理实例
6. **等待就绪** —— 轮询部署状态直到 `RUNNING`
7. **交付调用** —— 给出可直接运行的推理示例:文本模型用 `bl text chat`,音频 TTS 用 `bl speech synthesize --voice default`,图像生成用异步 API + 触发词,加常用运维命令
@@ -47,7 +47,7 @@
## 安全护栏
`bl finetune create` 与 `bl deploy create` 都是真实写操作,会产生计费资源。`bl` **没有 `--dry-run`**,所以用真实预检 + 计费闸门代替:
`bl finetune <模态> create` 与 `bl deploy <模态> create` 都是真实写操作,会产生计费资源。`bl` **没有 `--dry-run`**,所以用真实预检 + 计费闸门代替:
1. **预检代替 dry-run** —— `bl finetune capability --model <base>`(训练支持)、`bl deploy models --source custom|base`(可部署 + 可用 plan)、`bl deploy list --status RUNNING`(复用已有同模型部署,不再建第二个计费实例)。
2. **mu/ptu 计费闸门** —— `lora`(token 计费,闲置一般免费)是安全默认;`mu`/`ptu` 是预留资源、闲置也计费,创建前**必须取得用户显式确认**,在 agent/CI 等非交互环境**不用 `--yes` 替用户放行**。
@@ -65,10 +65,10 @@ Skill 会走两段链路,在两处「等待」用 Monitor 异步轮询:
```
链路 A(先训练后部署):
数据集 → finetune create → 等 SUCCEEDED → (自动导出) → deploy create → 等 RUNNING → text chat
数据集 → finetune <模态> create → 等 SUCCEEDED → (自动导出) → deploy <模态> create → 等 RUNNING → text chat
链路 B(直接部署基座,跳过训练):
基座 → deploy create → 等 RUNNING → text chat
基座 → deploy <模态> create → 等 RUNNING → text chat
```
每一步捕获正确的 id(`job_id` / `finetuned_output` → `deployed_model`),并绕开常见坑(例如直接用 `qwen3-8b-ft-...` 名字调用会 404 —— 必须先部署,再用响应里的 `deployed_model` 实例 id 调用)。
@@ -87,15 +87,15 @@ Skill 会走两段链路,在两处「等待」用 Monitor 异步轮询:
→ 前置检查:认证 + 训练能力(listFoundationModels,走 API key)
→ 模态分发:文本 → text.md | 音频 TTS → audio.md | 图像生成 → image.md
→ 准备并校验数据集(文本 .jsonl / 音频 .zip / 图像 .zip)
→ finetune create(默认 sft-lora;CLI 值映射到服务端字段;音频/图像超参自动注入)
→ finetune <模态> create(默认 sft-lora;CLI 值映射到服务端字段;音频/图像超参自动注入)
→ Monitor wait.sh finetune <JOB_ID> (30s 轮询,异步)
→ 自动导出 best checkpoint(通常跳过手动导出)
→ deploy create(按模型来源和模态选 plan:文本微调用 lora/mu,音频 TTS 只支持 mu,图像生成只支持 lora)
→ deploy <模态> create(按模型来源和模态选 plan:文本微调用 lora/mu,音频 TTS 只支持 mu,图像生成只支持 lora)
→ Monitor wait.sh deploy <DEPLOYED_MODEL> (15s 轮询,异步)
→ 调用:文本 → text chat | 音频 TTS → speech synthesize | 图像生成 → 异步 API + 触发词
```
Skill 把完整编排和高频避坑点都固化进去(zsh 的 `status` 是只读变量、`--model` 在 `deploy create` 与推理命令里含义不同、刚到 `RUNNING` 时状态传播延迟导致 404、`lora` / `mu` / `ptu` 闲置计费差异、音频 TTS 只支持 mu plan、图像生成只支持 lora plan、图像推理需异步调用 + 触发词),让 Agent 不必重新踩坑。
Skill 把完整编排和高频避坑点都固化进去(zsh 的 `status` 是只读变量、`--model` 在 `deploy <模态> create` 与推理命令里含义不同、刚到 `RUNNING` 时状态传播延迟导致 404、`lora` / `mu` / `ptu` 闲置计费差异、音频 TTS 只支持 mu plan、图像生成只支持 lora plan、图像推理需异步调用 + 触发词),让 Agent 不必重新踩坑。
## 模态扩展架构
+18 -18
View File
@@ -9,10 +9,10 @@ description: 用百炼 CLI (`bl`) 走完"数据→微调训练→导出→部署
```
链路 A(先训练后部署):
数据集 → finetune create → 等 SUCCEEDED → 导出模型(通常自动) → deploy create → 等 RUNNING → 调用
数据集 → finetune <模态> create → 等 SUCCEEDED → 导出模型(通常自动) → deploy <模态> create → 等 RUNNING → 调用
链路 B(直接部署基座,跳过训练):
选基座 → deploy create → 等 RUNNING → 调用
选基座 → deploy <模态> create → 等 RUNNING → 调用
```
链路 B 适用于"只想把某个基座跑成自己的部署服务"——和直接调用 API 在推理上没本质区别,但能拿到独立部署实例、可调速率/计费方式、纳入自己的运维。**仅当用户明确表示不训练 / 跳过训练 / 直接部署基座时才走这条**;用户只是没提训练细节时,默认按链路 A 引导,不要擅自跳过训练。
@@ -27,7 +27,7 @@ description: 用百炼 CLI (`bl`) 走完"数据→微调训练→导出→部署
## 写操作护栏(创建前必读)
`bl finetune create` 与 `bl deploy create` 都是真实写操作,会产生计费资源(微调训练 + 推理部署)。`bl` **没有 `--dry-run`**,所以用**预检命令**代替预演、用**计费确认**把关预留资源。任何写操作前必须先过这三道闸:
`bl finetune <模态> create` 与 `bl deploy <模态> create` 都是真实写操作,会产生计费资源(微调训练 + 推理部署)。`bl` **没有 `--dry-run`**,所以用**预检命令**代替预演、用**计费确认**把关预留资源。任何写操作前必须先过这三道闸:
1. **预检代替 dry-run**(创建前必跑,确认可行再写)。这些预检命令本身都需先通过下方[前置检查](#前置检查动作流起点)的认证——未认证先 `bl auth login` 再预检:
- 训练前:`bl finetune capability --model <base>` —— 确认基座支持你选的 training-type(不支持会快速失败且不耗配额;`create` 提交时也会再校验一次)。
@@ -54,17 +54,17 @@ description: 用百炼 CLI (`bl`) 走完"数据→微调训练→导出→部署
## 反幻觉清单
- **`--model` 在不同命令里含义不同,切勿复用**:
- `bl finetune create --model` → 基座模型名(文本 `qwen3-8b`,音频 `cosyvoice-v3-flash`,图像 `wan2.7-image-pro`)。
- `bl deploy create --model` → 导出模型名(链路 A:`qwen3-8b-ft-...` / `cosyvoice-v3-flash-ft-...` / `wan2.7-image-pro-ft-...`;链路 B:基座名)。
- 推理命令 `--model` → 必须用 `deploy create` 响应里的 `deployed_model`,**不是**你传给 deploy create 的名字。
- **`--training-type` 取值穷举**:`sft` / `sft-lora`(默认)/ `dpo` / `dpo-lora` / `cpt`。映射在 CLI 边界完成(`sft-lora`→`efficient_sft`),永远传 CLI 值,不要传服务端字符串。`cpt` 无 `-lora` 变体。音频 TTS 和图像生成都只用 `sft-lora`。
- `bl finetune <模态> create --model` → 基座模型名(文本 `qwen3-8b`,音频 `cosyvoice-v3-flash`,图像 `wan2.7-image-pro`)。
- `bl deploy <模态> create --model` → 导出模型名(链路 A:`qwen3-8b-ft-...` / `cosyvoice-v3-flash-ft-...` / `wan2.7-image-pro-ft-...`;链路 B:基座名)。
- 推理命令 `--model` → 必须用 `deploy <模态> create` 响应里的 `deployed_model`,**不是**你传给 deploy <模态> create 的名字。
- **`--training-type` 取值穷举**:`sft` / `sft-lora`(默认)/ `dpo` / `dpo-lora` / `cpt`。映射在 CLI 边界完成(`sft-lora`→`efficient_sft`),永远传 CLI 值,不要传服务端字符串。`cpt` 无 `-lora` 变体。音频 TTS 和图像生成都只用 `sft-lora`——`finetune audio create` / `finetune image create` **不暴露此 flag**,仅 `finetune text create` 接受。
- **`--plan` 取值穷举**:`lora`(默认,token 计费)/ `ptu`(需 `--input-tpm`/`--output-tpm`)/ `mu`(需 `--deploy-spec`/`--capacity`)。链路 B 基座通常**不支持 `lora`**。音频 TTS 微调模型**只支持 `mu`**。图像生成微调模型**只支持 `lora`**。
- **`--deploy-spec`**(非 ~~template-id~~):mu plan 的部署规格 flag。CLI 从 catalog 读取 `template_id`,在请求体中发送为 `deploy_spec`。
- **`--source` 取值穷举**(`bl deploy models`):`custom`(微调输出)/ `base`(基座)/ `public`。
- **`--learning-rate` 必须字符串**:传 `"3e-4"`,不要传数字 `3e-4`,避免 JSON 精度丢失(文本适用,音频/图像不需要传此参数)。
- **推理命令因模态不同**:文本模型用 `bl text chat`,音频 TTS 用 `bl speech synthesize --voice default`,图像生成用异步 API + 触发词(详见 [`references/image.md`](references/image.md#推理与调用))。
- **没有这些 flag/子命令**:`bl` 无 `--dry-run`、无 `deploy create create`、无 `finetune start`、无 `deploy stop`(CLI 暂无 stop 命令,RUNNING 的 mu/ptu 需到控制台停用)。
- **必填**:`finetune create` 的 `--model` / `--datasets`;`deploy create` 的 `--model` / `--name`。
- **没有这些 flag/子命令**:`bl` 无 `--dry-run`、无裸 `finetune create`/`deploy create`(**必须带模态段**:`finetune text|audio|image create`、`deploy text|audio|image create`)、无 `finetune start`、无 `deploy stop`(CLI 暂无 stop 命令,RUNNING 的 mu/ptu 需到控制台停用)。
- **必填**:`finetune <模态> create` 的 `--model` / `--datasets`;`deploy <模态> create` 的 `--model` / `--name`。
## 前置检查(动作流起点)
@@ -72,7 +72,7 @@ description: 用百炼 CLI (`bl`) 走完"数据→微调训练→导出→部署
- 基座选型:查询训练能力用 `bl finetune capability`(查 listFoundationModels,走 API key、无需 console 登录):
- `bl finetune capability --model <base>` —— 该模型支持哪些训练类型。
- `bl finetune capability --training-type sft-lora` —— 反向查:哪些模型支持该训练类型(返回 `models` 列表,含中文名)。
- 选定基座后可直接进入第 2 步;`bl finetune create` 提交前也会再用 listFoundationModels 校验,不支持会快速失败。
- 选定基座后可直接进入第 2 步;`bl finetune <模态> create` 提交前也会再用 listFoundationModels 校验,不支持会快速失败。
- 文本推理推荐 Qwen3 系列(`qwen3-8b` / `qwen3-14b` / `qwen3.6-flash`);音频 TTS 用 `cosyvoice-v3-flash`;图像生成用 `wan2.7-image-pro` / `wan2.7-image`。
## 第 1 步:准备数据集
@@ -93,17 +93,16 @@ description: 用百炼 CLI (`bl`) 走完"数据→微调训练→导出→部署
## 第 2 步:创建微调任务
```bash
bl finetune create \
bl finetune <模态> create \
--model <base-model> \
--datasets <path-or-file-id> \
--training-type sft-lora \
--yes --output json
```
**training-type 取值与映射**详见 [`references/finetune.md`](references/finetune.md)。**模态特异性超参**见对应参考文件:
- 文本模型:`--n-epochs` / `--learning-rate` 等,详见 [`references/text.md`](references/text.md#创建训练任务)。
- 音频 TTS:`--training-type` 固定 `sft-lora`,超参由 CLI 自动注入,详见 [`references/audio.md`](references/audio.md#创建训练任务)。
- 图像生成:`--training-type` 固定 `sft-lora`,超参由 CLI 自动注入,详见 [`references/image.md`](references/image.md#创建训练任务)。
- 文本模型(`finetune text create`):接受 `--training-type` / `--n-epochs` / `--learning-rate` 等,详见 [`references/text.md`](references/text.md#创建训练任务)。
- 音频 TTS(`finetune audio create`):**不暴露 `--training-type`**(内部固定 `sft-lora`),超参由 CLI 自动注入,详见 [`references/audio.md`](references/audio.md#创建训练任务)。
- 图像生成(`finetune image create`):**不暴露 `--training-type`**(内部固定 `sft-lora`),超参由 CLI 自动注入,详见 [`references/image.md`](references/image.md#创建训练任务)。
从响应记下:`output.job_id`、`output.finetuned_output`(输出模型名,形如 `<base>-ft-<ts>-<id>`)。
@@ -136,13 +135,14 @@ bl finetune export --job-id <JOB_ID> --checkpoint <name> --model-name <自定义
⚠️ **关键避坑:微调后的模型不能直接用微调输出名调用,会 404 `Model not exist`。必须先创建部署。**(链路 B 部署基座同理——直接调用走的是公共推理,不经过你的部署实例。)
```bash
bl deploy create \
bl deploy <模态> create \
--model <model-name> \ # 微调输出名(链路A) 或基座名(链路B)
--name <display-name> \
--plan <lora|ptu|mu> \ # 见下方说明
--yes --output json
```
- **模态段**(`text` / `audio` / `image`)须与部署模型模态匹配;三个模态子命令 flag 完全相同。
- `--model`:链路 A 传第 2 步的 `finetuned_output`;链路 B 直接传基座模型名。
- `--plan`:
- 文本微调模型默认 `lora`(token 计费),也可用 `mu`。
@@ -153,7 +153,7 @@ bl deploy create \
- `--deploy-spec`:mu plan 的部署规格(如 `dps-20260521172224-1vabse`),省略时自动从 catalog 匹配。
- 不确定支持哪些 plan:链路 A 用 `bl deploy models --source custom`,链路 B 用 `bl deploy models --source base`,按返回的 `plans` 选。
⚠️ **避坑(最高频错误):`--model` 在 `deploy create` 与推理命令里含义不同**——`deploy create --model` 传导出模型名,响应返回的 `output.deployed_model` 才是部署实例 id,推理命令 `--model` 必须用 `deployed_model`,**不要复用**。详见 [`references/deploy.md`](references/deploy.md)。
⚠️ **避坑(最高频错误):`--model` 在 `deploy <模态> create` 与推理命令里含义不同**——`deploy <模态> create --model` 传导出模型名,响应返回的 `output.deployed_model` 才是部署实例 id,推理命令 `--model` 必须用 `deployed_model`,**不要复用**。详见 [`references/deploy.md`](references/deploy.md)。
从响应记下:`output.deployed_model`。
@@ -186,7 +186,7 @@ bl speech synthesize --model <DEPLOYED_MODEL> --voice default --text "你要合
# 详见 references/image.md —— 需 X-DashScope-Async 头 + prompt 含触发词
```
> `--model` 必须用 `deploy create` 响应中的 `deployed_model`,**不是**微调输出名。音频 TTS 的 `--voice` 固定为 `default`。图像生成需异步调用且 prompt 包含触发词。详见对应模态参考文件。
> `--model` 必须用 `deploy <模态> create` 响应中的 `deployed_model`,**不是**微调输出名。音频 TTS 的 `--voice` 固定为 `default`。图像生成需异步调用且 prompt 包含触发词。详见对应模态参考文件。
向用户交付时给出:
- **部署实例 id**(`deployed_model`)——调用用它,不是微调输出名
@@ -50,15 +50,14 @@ pip install edge-tts
## 创建训练任务
```bash
bl finetune create \
bl finetune audio create \
--model cosyvoice-v3-flash \
--datasets <zip-path-or-file-id> \
--training-type sft-lora \
--yes --output json
```
要点:
- `--training-type` 固定 `sft-lora`(CLI 映射到 `efficient_sft`),音频不支持全参 sft / dpo / cpt
- 音频微调固定用 `sft-lora`(映射到 `efficient_sft`)——`finetune audio create` **不暴露 `--training-type`**,无需也不能传;不支持全参 sft / dpo / cpt
- **无需手动传超参**——8 个音频专有超参(lm_max_epoch、fm_max_epoch 等)由 CLI 自动注入默认值
- `--n-epochs` / `--learning-rate` / `--batch-size` 等文本超参对音频无效,不要传
- capability 检查可能显示 `supports.sft=false`,这是已知矛盾(API 元数据与实际行为不一致),CLI 已自动跳过
@@ -72,7 +71,7 @@ bl finetune create \
## 部署
```bash
bl deploy create \
bl deploy audio create \
--model <finetuned_output> \
--name <display-name> \
--plan mu \
@@ -100,7 +99,7 @@ bl speech synthesize \
```
要点:
- `--model` 必须用 `deploy create` 响应中的 `deployed_model`(如 `cosyvoice-v3-flash-9d4f3eeb27ca`),**不是** `finetuned_output`
- `--model` 必须用 `deploy audio create` 响应中的 `deployed_model`(如 `cosyvoice-v3-flash-9d4f3eeb27ca`),**不是** `finetuned_output`
- `--voice` 必须为 `default`(微调模型只有这一个 voice)
- 输出为音频文件(mp3/wav/pcm/opus),用 `--format` 指定
- 推理秒级返回
@@ -33,9 +33,9 @@
## --model 在不同命令里含义不同(最高频错误,切勿混用)
- `bl deploy create --model` 传的是**导出模型名**(`qwen3-8b-ft-...`,链路 A 来自第 2 步 `finetuned_output`;链路 B 直接传基座名 `qwen3-8b`)。
- `bl deploy <模态> create --model` 传的是**导出模型名**(`qwen3-8b-ft-...`,链路 A 来自第 2 步 `finetuned_output`;链路 B 直接传基座名 `qwen3-8b`)。
- 响应里返回的 `output.deployed_model`(如 `qwen3-8b-b98a331831a7`)才是**部署实例 id**。
- 下一步推理(`bl text chat` / `bl speech synthesize` / 异步 API)`--model` 必须用响应里的 `deployed_model`,**不是**你传给 `deploy create` 的名字。两个 `--model` 指向不同值,不要复用。
- 下一步推理(`bl text chat` / `bl speech synthesize` / 异步 API)`--model` 必须用响应里的 `deployed_model`,**不是**你传给 `deploy <模态> create` 的名字。两个 `--model` 指向不同值,不要复用。
## 计费与运维细则
@@ -43,7 +43,7 @@
- **删除约束**:`bl deploy delete` 只能删 `STOPPED` / `FAILED` 状态的部署;CLI 暂无 `stop` 命令——`RUNNING` 状态的 mu/ptu 需先到百炼控制台停用,再删;或用 `bl deploy delete --deployed-model <id> --skip-precheck` 尝试(跳过本地前置检查,但服务端仍可能拒绝 RUNNING 删除)。
- **状态传播延迟**:部署刚到 `RUNNING` 时立即调用可能短暂 404 `Model not exist`,是服务端状态传播延迟,约 1 分钟内稳定,遇 404 等十几秒重试;若持续 404,先核对用的是 `deployed_model` 而非微调输出名。
## 必填 flag(`bl deploy create`)
## 必填 flag(`bl deploy <模态> create`)
- `--model`:导出模型名(见上方歧义说明)。
- `--name`:控制台显示名。
@@ -14,7 +14,7 @@ CLI 用 `<method>` / `<method>-lora` 约定,提交时在 CLI 边界映射到
| `cpt` | 继续预训练 | 文本 | 注入领域知识,需非对话格式数据 |
> `cpt` 服务端没有 `-lora` 变体,只有全参;其余方法(sft / dpo)均有 `<method>` 与 `<method>-lora` 两个变体。
> 音频 TTS 和图像生成都只用 `sft-lora`(映射到 `efficient_sft`),不支持其他 training-type。
> 音频 TTS 和图像生成都只用 `sft-lora`(映射到 `efficient_sft`),不支持其他 training-type;且 `finetune audio create` / `finetune image create` **不暴露 `--training-type` flag**(内部固定 sft-lora),该 flag 仅 `finetune text create` 接受。
## 超参建议
@@ -46,6 +46,6 @@ CLI 用 `<method>` / `<method>-lora` 约定,提交时在 CLI 边界映射到
## 提交前校验
`bl finetune create` 提交前会用 listFoundationModels 校验模型是否支持所选 training-type,不支持会快速失败(不耗配额)。若训练集样本数 ≤ batch_size,会在上传/耗配额前被拒。可用 `bl finetune capability --model <base>` 提前确认。
`bl finetune <模态> create` 提交前会用 listFoundationModels 校验模型是否支持所选 training-type,不支持会快速失败(不耗配额)。若训练集样本数 ≤ batch_size,会在上传/耗配额前被拒。可用 `bl finetune capability --model <base>` 提前确认。
> **已知矛盾**:cosyvoice-v3-flash 和 wan2.7 系列的 capability 返回 `supports.sft=false`,但 API 实际接受 `efficient_sft` 训练请求。CLI 已对音频和图像模态自动跳过此检查。
@@ -54,25 +54,23 @@ bl dataset validate --file <zip-path> --schema image # 显式指定
## 创建训练任务
```bash
bl finetune create \
bl finetune image create \
--model wan2.7-image-pro \
--datasets <zip-path-or-file-id> \
--training-type sft-lora \
--yes --output json
```
I2I(图生图)模式**自动检测**——只要 JSONL 中有 `input_img` 字段,CLI 自动识别为 I2I 并调整超参(`max_pixels`/`val_img_size` 从 "2k" 切换为 "1k"),无需额外 flag:
```bash
bl finetune create \
bl finetune image create \
--model wan2.7-image-pro \
--datasets <i2i-zip-path-or-file-id> \
--training-type sft-lora \
--yes --output json
```
要点:
- `--training-type` 固定 `sft-lora`(CLI 映射到 `efficient_sft`),图像不支持全参 sft / dpo / cpt
- 图像微调固定用 `sft-lora`(映射到 `efficient_sft`)——`finetune image create` **不暴露 `--training-type`**,无需也不能传;不支持全参 sft / dpo / cpt
- **无需手动传超参**——12 个图像专有超参由 CLI 自动注入默认值
- T2I/I2I 由数据内容自动推断(首行有 `input_img` → I2I,否则 T2I),`max_pixels`/`val_img_size` 随之自动调整
- `--n-epochs` / `--batch-size` 等文本超参对图像无效,不要传
@@ -87,7 +85,7 @@ bl finetune create \
## 部署
```bash
bl deploy create \
bl deploy image create \
--model <finetuned_output> \
--name <display-name> \
--plan lora \
@@ -123,7 +121,7 @@ curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image-generati
```
要点:
- `model` 必须用 `deploy create` 响应中的 `deployed_model`,**不是** `finetuned_output`
- `model` 必须用 `deploy image create` 响应中的 `deployed_model`,**不是** `finetuned_output`
- 请求头必须带 `X-DashScope-Async: enable`(异步模式)
- `prompt` 中**必须包含触发词**(训练完成后平台会告知,形如 `s86b5p`)
- 返回 `task_id`,通过轮询获取结果
@@ -34,7 +34,7 @@ bl dataset validate --file <jsonl-path> --schema dpo # 显式指定
## 创建训练任务
```bash
bl finetune create \
bl finetune text create \
--model qwen3-8b \
--datasets <path-or-file-id> \
--training-type sft-lora \
@@ -60,7 +60,7 @@ bl finetune create \
## 部署
```bash
bl deploy create \
bl deploy text create \
--model <finetuned_output> \
--name <display-name> \
--plan lora \
@@ -77,5 +77,5 @@ bl deploy create \
bl text chat --model <DEPLOYED_MODEL> --message "你的问题"
```
- `--model` 必须用 `deploy create` 响应中的 `deployed_model`,**不是** `finetuned_output`
- `--model` 必须用 `deploy text create` 响应中的 `deployed_model`,**不是** `finetuned_output`
- 建议带一个推理类问题演示效果