@@ -347,18 +347,15 @@ def get_command_using_train_func(
347347def get_trainer_cr_from_custom_trainer (
348348 runtime : types .Runtime ,
349349 trainer : Union [types .CustomTrainer , types .CustomTrainerContainer ],
350- trainer_overrides : Optional [dict [str , Any ]] = None ,
351350) -> models .TrainerV1alpha1Trainer :
352351 """
353352 Get the Trainer CR from the custom trainer.
354353
355354 Args:
356355 runtime: The runtime configuration.
357356 trainer: The custom trainer or container configuration.
358- trainer_overrides: Optional overrides for image, command, or args from options.
359357 """
360358 trainer_cr = models .TrainerV1alpha1Trainer ()
361- trainer_overrides = trainer_overrides or {}
362359
363360 # Add number of nodes to the Trainer.
364361 if trainer .num_nodes :
@@ -370,14 +367,13 @@ def get_trainer_cr_from_custom_trainer(
370367
371368 if isinstance (trainer , types .CustomTrainer ):
372369 # If CustomTrainer is used, generate command from function.
373- if trainer .func is not None :
374- trainer_cr .command = get_command_using_train_func (
375- runtime ,
376- trainer .func ,
377- trainer .func_args ,
378- trainer .pip_index_urls ,
379- trainer .packages_to_install ,
380- )
370+ trainer_cr .command = get_command_using_train_func (
371+ runtime ,
372+ trainer .func ,
373+ trainer .func_args ,
374+ trainer .pip_index_urls ,
375+ trainer .packages_to_install ,
376+ )
381377 else :
382378 # Alternatively, set the Trainer image.
383379 trainer_cr .image = trainer .image
0 commit comments