fix: ignore case when checking metric name (#1160)

* fix: ignore case when checking metric name

* add case-sensitive to prompts

---------

Co-authored-by: amstrongzyf <amstrongzyf@126.com>
This commit is contained in:
Jensen Lee
2025-08-06 20:54:08 +08:00
committed by GitHub
parent d771b26a26
commit 1b84f7b754
6 changed files with 11 additions and 12 deletions
@@ -140,8 +140,8 @@ class PipelineCoSTEEREvaluator(CoSTEEREvaluator):
if score_ret_code != 0:
score_check_text += f"The dataframe in file 'scores.csv' is:\n{score_df}"
# Check metric name (columns)
if score_df.columns.tolist() != [self.scen.metric_name]:
# Check metric name (columns) - case insensitive
if [col.lower() for col in score_df.columns.tolist()] != [self.scen.metric_name.lower()]:
score_check_text += f"\n[Error] The scores dataframe does not contain the correct column names.\nCorrect columns is: ['{self.scen.metric_name}']\nBut got: {score_df.columns.tolist()}"
score_ret_code = 1
@@ -105,8 +105,8 @@ class WorkflowGeneralCaseSpecEvaluator(CoSTEEREvaluator):
score_check_text += f"\n[Error] The scores dataframe does not contain the correct model names as index.\ncorrect model names are: {model_set_in_folder.union({'ensemble'})}\nscore_df is:\n{score_df}"
score_ret_code = 1
# Check metric name (columns)
if score_df.columns.tolist() != [self.scen.metric_name]:
# Check metric name (columns) - case insensitive
if [col.lower() for col in score_df.columns.tolist()] != [self.scen.metric_name.lower()]:
score_check_text += f"\n[Error] The scores dataframe does not contain the correct column names.\nCorrect columns is: ['{self.scen.metric_name}']\nBut got: {score_df.columns.tolist()}"
score_ret_code = 1