@@ -18,7 +18,7 @@ const UPLOAD_FLAGS = {
1818 file : {
1919 type : "string" ,
2020 valueHint : "<path>" ,
21- description : "Local dataset file (.jsonl or .zip; ≤300MB text, ≤1GB image/video )" ,
21+ description : "Local dataset file (.jsonl or .zip; ≤300MB text, ≤1GB image)" ,
2222 required : true ,
2323 } ,
2424 purpose : {
@@ -30,7 +30,7 @@ const UPLOAD_FLAGS = {
3030 type : "string" ,
3131 valueHint : "<s>" ,
3232 description :
33- 'Record schema: "chatml" (SFT), "dpo" (chosen/rejected), "cpt" (raw text), "tts" (audio), "image" (image generation), or "video " (video generation). Default auto-detects per record.' ,
33+ 'Record schema: "chatml" (SFT), "dpo" (chosen/rejected), "cpt" (raw text), "tts" (audio), or "image " (image generation). Default auto-detects per record.' ,
3434 } ,
3535 noValidate : {
3636 type : "switch" ,
@@ -46,7 +46,7 @@ export default defineCommand({
4646 description : "Upload a dataset file (.jsonl or .zip) to Bailian" ,
4747 auth : "apiKey" ,
4848 usageArgs :
49- "--file <path> [--purpose <name>] [--schema <chatml|dpo|cpt|tts|image|video >] [--no-validate] [--full-validate]" ,
49+ "--file <path> [--purpose <name>] [--schema <chatml|dpo|cpt|tts|image>] [--no-validate] [--full-validate]" ,
5050 flags : UPLOAD_FLAGS ,
5151 exampleArgs : [
5252 "--file train.jsonl" ,
@@ -58,27 +58,32 @@ export default defineCommand({
5858 "--file train.jsonl --no-validate" ,
5959 ] ,
6060 notes : [
61- "Supports .jsonl (text) and .zip (audio/image/video archives with a" ,
62- "data.jsonl manifest). Six record schemas are recognized: chatml =" ,
63- "{messages:[...]} (SFT); dpo = {messages:[...], chosen, rejected};" ,
64- 'cpt = {text:"..."} (continual pre-training, raw text); tts =' ,
65- '{wav_fn:"train/xxx.wav", text:"..."} (audio fine-tuning); image =' ,
66- '{img_path:"..."} (image generation); video = {first_frame_path:"...",' ,
67- 'video_path:"..."} (video generation). With no --schema, a record' ,
68- "carrying wav_fn is validated as TTS, img_path as image, video_path /" ,
69- "first_frame_path as video, chosen/rejected as DPO, text (no messages)" ,
70- "as CPT, otherwise ChatML. Upload cap: 300MB text, 1GB image/video." ,
71- "Upload uses the OpenAI-compatible /compatible-mode/v1/files endpoint so" ,
72- "the purpose tag is persisted (the DashScope-native /api/v1/files drops it)." ,
61+ "Supports .jsonl (text) and .zip (audio/image archives with a data.jsonl" ,
62+ "manifest). Five record schemas are recognized: chatml = {messages:[...]}" ,
63+ '(SFT); dpo = {messages:[...], chosen, rejected}; cpt = {text:"..."}' ,
64+ '(continual pre-training, raw text); tts = {wav_fn:"train/xxx.wav",' ,
65+ 'text:"..."} (audio fine-tuning); image = {img_path:"..."} (image' ,
66+ "generation). With no --schema, a record carrying wav_fn is validated as" ,
67+ "TTS, img_path as image, chosen/rejected as DPO, text (no messages) as CPT," ,
68+ "otherwise ChatML. Upload cap: 300MB text, 1GB image. Upload uses the" ,
69+ "OpenAI-compatible /compatible-mode/v1/files endpoint so the purpose tag is" ,
70+ "persisted (the DashScope-native /api/v1/files drops it)." ,
7371 ] ,
7472 async run ( ctx ) {
7573 const { identity, settings, flags } = ctx ;
7674 const filePath = flags . file ;
7775 const purpose = flags . purpose || "fine-tune" ;
7876 const schema = parseDatasetSchemaFlag ( flags . schema ) ;
77+ if ( schema === "video" ) {
78+ throw new BailianError (
79+ `--schema video is not supported.` ,
80+ ExitCode . USAGE ,
81+ `Supported schemas: chatml, dpo, cpt, tts, image.` ,
82+ ) ;
83+ }
7984 const format = detectOutputFormat ( settings . output ) ;
80- // Image / video schemas allow larger ZIPs (1 GB vs 300 MB for text).
81- const isMediaSchema = schema === "image" || schema === "video" ;
85+ // Image schema allows larger ZIPs (1 GB vs 300 MB for text).
86+ const isMediaSchema = schema === "image" ;
8287
8388 if ( ! flags . noValidate ) {
8489 const maxBytes = isMediaSchema ? MAX_MEDIA_ZIP_BYTES : MAX_DATASET_BYTES ;
0 commit comments