From 796239ee761b5bb9b5d59231fd553dbf73cc30ef Mon Sep 17 00:00:00 2001 From: babu-namburi Date: Wed, 4 Jun 2025 10:08:17 +0530 Subject: [PATCH] Fix for ev2 failure. using a different keyword for no --- .../components/finetune/chat_completion/spec.yaml | 2 +- .../pipeline_components/chat_completion/spec.yaml | 2 +- .../training/finetune_acft_hf_nlp/src/finetune/finetune.py | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/training/finetune_acft_hf_nlp/components/finetune/chat_completion/spec.yaml b/assets/training/finetune_acft_hf_nlp/components/finetune/chat_completion/spec.yaml index 003380c4f0..83c9f28f15 100644 --- a/assets/training/finetune_acft_hf_nlp/components/finetune/chat_completion/spec.yaml +++ b/assets/training/finetune_acft_hf_nlp/components/finetune/chat_completion/spec.yaml @@ -213,7 +213,7 @@ inputs: enum: - epoch - steps - - "no" + - disable description: The evaluation strategy to adopt during training. If set to "steps", either the `evaluation_steps_interval` or `eval_steps` needs to be specified, which helps to determine the step at which the model evaluation needs to be computed else evaluation happens at end of each epoch. evaluation_steps_interval: diff --git a/assets/training/finetune_acft_hf_nlp/components/pipeline_components/chat_completion/spec.yaml b/assets/training/finetune_acft_hf_nlp/components/pipeline_components/chat_completion/spec.yaml index 91017e77fb..104485780c 100644 --- a/assets/training/finetune_acft_hf_nlp/components/pipeline_components/chat_completion/spec.yaml +++ b/assets/training/finetune_acft_hf_nlp/components/pipeline_components/chat_completion/spec.yaml @@ -321,7 +321,7 @@ inputs: enum: - epoch - steps - - "no" + - disable description: The evaluation strategy to adopt during training. If set to "steps", either the `evaluation_steps_interval` or `eval_steps` needs to be specified, which helps to determine the step at which the model evaluation needs to be computed else evaluation happens at end of each epoch. evaluation_steps_interval: diff --git a/assets/training/finetune_acft_hf_nlp/src/finetune/finetune.py b/assets/training/finetune_acft_hf_nlp/src/finetune/finetune.py index 35bca4dfb4..619a65256f 100644 --- a/assets/training/finetune_acft_hf_nlp/src/finetune/finetune.py +++ b/assets/training/finetune_acft_hf_nlp/src/finetune/finetune.py @@ -442,7 +442,7 @@ def get_parser(): type=str, default="epoch", choices=( - "no", + "disable", "steps", "epoch", ), @@ -1275,6 +1275,10 @@ def finetune(args: Namespace): validate_learning_rate(args) + # Fix: Ev2 rollout fails when using no as string in the spec. + if args.evaluation_strategy == 'disable': + args.evaluation_strategy = 'no' + if not hasattr(args, "eval_strategy"): args.eval_strategy = args.evaluation_strategy # validate early stop settings