@@ -344,8 +344,7 @@ def _poll_evaluator_status(
344344
345345
346346def create_rft_command (args ) -> int :
347- # Accept both new and legacy names for backwards-compat
348- evaluator_id : Optional [str ] = getattr (args , "evaluator" , None ) or getattr (args , "evaluator_id" , None )
347+ evaluator_id : Optional [str ] = getattr (args , "evaluator" , None )
349348 non_interactive : bool = bool (getattr (args , "yes" , False ))
350349 dry_run : bool = bool (getattr (args , "dry_run" , False ))
351350 force : bool = bool (getattr (args , "force" , False ))
@@ -374,19 +373,19 @@ def create_rft_command(args) -> int:
374373 print ("No evaluation tests found." )
375374 print ("\n Hint: Make sure your tests use the @evaluation_test decorator." )
376375 return 1
377- # Always interactive selection here (no implicit quiet unless --evaluator-id was provided)
376+ # Always interactive selection here
378377 try :
379378 selected_tests = _prompt_select (tests , non_interactive = non_interactive )
380379 except Exception :
381- print ("Error: Failed to open selector UI. Please pass --evaluator-id or --entry explicitly." )
380+ print ("Error: Failed to open selector UI. Please pass --evaluator or --entry explicitly." )
382381 return 1
383382 if not selected_tests :
384383 print ("No tests selected." )
385384 return 1
386385 if len (selected_tests ) != 1 :
387386 if non_interactive and len (selected_tests ) > 1 :
388387 print ("Error: Multiple evaluation tests found in --yes (non-interactive) mode." )
389- print (" Please pass --evaluator-id or --entry to disambiguate." )
388+ print (" Please pass --evaluator or --entry to disambiguate." )
390389 try :
391390 # Offer candidate evaluator ids for convenience
392391 tests = _discover_tests (project_root )
@@ -476,10 +475,10 @@ def create_rft_command(args) -> int:
476475 # If still unresolved and multiple tests exist, fail fast to avoid uploading unintended evaluators
477476 if selected_entry is None and len (tests ) > 1 :
478477 print (
479- f"Error: Multiple evaluation tests found, and the selected evaluator_id { evaluator_id } does not match any discovered test.\n "
480- " Please re-run specifying the evaluator id .\n "
478+ f"Error: Multiple evaluation tests found, and the selected evaluator { evaluator_id } does not match any discovered test.\n "
479+ " Please re-run specifying the evaluator.\n "
481480 " Hints:\n "
482- " - eval-protocol create rft --evaluator-id <existing-evaluator-id>\n "
481+ " - eval-protocol create rft --evaluator <existing-evaluator-id>\n "
483482 )
484483 return 1
485484
@@ -529,8 +528,7 @@ def create_rft_command(args) -> int:
529528 print (f"Warning: Failed to upload evaluator automatically: { e } " )
530529
531530 # Determine dataset id and materialization path
532- # Accept both new and legacy names for dataset
533- dataset_id = getattr (args , "dataset" , None ) or getattr (args , "dataset_id" , None )
531+ dataset_id = getattr (args , "dataset" , None )
534532 dataset_jsonl = getattr (args , "dataset_jsonl" , None )
535533 dataset_display_name = getattr (args , "dataset_display_name" , None )
536534 dataset_builder = getattr (args , "dataset_builder" , None ) # accepted but unused in simplified flow
@@ -585,7 +583,7 @@ def create_rft_command(args) -> int:
585583 print (f"Warning: dataset builder failed: { e } " )
586584 if not dataset_jsonl :
587585 print (
588- "Error: Could not determine dataset. Provide --dataset-id or --dataset-jsonl, or ensure a JSONL-based data loader or input_dataset is used in your single discovered test."
586+ "Error: Could not determine dataset. Provide --dataset or --dataset-jsonl, or ensure a JSONL-based data loader or input_dataset is used in your single discovered test."
589587 )
590588 return 1
591589
@@ -640,7 +638,7 @@ def create_rft_command(args) -> int:
640638 ("learningRate" , "learning_rate" ),
641639 ("maxContextLength" , "max_context_length" ),
642640 ("loraRank" , "lora_rank" ),
643- ("gradAccumulationSteps " , "gradient_accumulation_steps" ),
641+ ("gradientAccumulationSteps " , "gradient_accumulation_steps" ),
644642 ("learningRateWarmupSteps" , "learning_rate_warmup_steps" ),
645643 ("acceleratorCount" , "accelerator_count" ),
646644 ("region" , "region" ),
@@ -655,13 +653,24 @@ def create_rft_command(args) -> int:
655653 ("topP" , "top_p" ),
656654 ("topK" , "top_k" ),
657655 ("maxTokens" , "max_output_tokens" ),
658- ("responseCandidatesCount " , "response_candidates_count" ),
656+ ("n " , "response_candidates_count" ),
659657 ]:
660658 val = getattr (args , arg_name , None )
661659 if val is not None :
662660 inference_params [key ] = val
663661 if getattr (args , "extra_body" , None ):
664- inference_params ["extraBody" ] = args .extra_body
662+ extra = getattr (args , "extra_body" )
663+ if isinstance (extra , (dict , list )):
664+ try :
665+ inference_params ["extraBody" ] = json .dumps (extra , ensure_ascii = False )
666+ except (TypeError , ValueError ) as e :
667+ print (f"Error: --extra-body dict/list must be JSON-serializable: { e } " )
668+ return 1
669+ elif isinstance (extra , str ):
670+ inference_params ["extraBody" ] = extra
671+ else :
672+ print ("Error: --extra-body must be a JSON string or a JSON-serializable dict/list." )
673+ return 1
665674
666675 wandb_config : Optional [Dict [str , Any ]] = None
667676 if getattr (args , "wandb_enabled" , False ):
@@ -688,7 +697,7 @@ def create_rft_command(args) -> int:
688697 "outputStats" : None ,
689698 "outputMetrics" : None ,
690699 "mcpServer" : getattr (args , "mcp_server" , None ),
691- "jobId" : getattr (args , "rft_job_id " , None ),
700+ "jobId" : getattr (args , "job_id " , None ),
692701 }
693702 # Debug: print minimal summary
694703 print (f"Prepared RFT job for evaluator '{ evaluator_id } ' using dataset '{ dataset_id } '" )
0 commit comments