@@ -29,7 +29,7 @@ class UnitxtEvaluator(MMLUBranchEvaluator):
2929 An evaluator class, running Unitxt evaluation
3030
3131 Attributes:
32- model_path absolute path to or name of a huggingface model
32+ model_path Absolute path to or name of a huggingface model
3333 unitxt_recipe unitxt recipe (see unitxt.ai for more information)
3434 A Recipe holds a complete specification of a unitxt pipeline
3535 Example: card=cards.wnli,template=templates.classification.multi_class.relation.default,max_train_instances=5,loader_limit=20,num_demos=3,demos_pool_size=10
@@ -71,16 +71,20 @@ def remove_unitxt_files(self):
7171 shutil .rmtree (self .tasks_dir )
7272 else :
7373 logger .warning (
74- "unitxt tasks dir did not start with '%s' and therefor was not deleted" ,
74+ "unitxt tasks dir '%s' did not start with '%s' prefix and therefore was not deleted" ,
75+ self .tasks_dir ,
7576 TEMP_DIR_PREFIX ,
7677 )
7778
7879 def run (self , server_url : str | None = None ) -> tuple :
7980 """
8081 Runs evaluation
8182
83+ Attributes:
84+ server_url(str|None) Model server endpoint (Ex: http://localhost:8000/v1) for the model being evaluated
85+
8286 Returns:
83- overall_scores Average scores for the task group
87+ overall_scores Average scores for the task group
8488 individual_scores Individual scores for each task in the task group
8589 """
8690 self .prepare_unitxt_files ()
@@ -111,8 +115,8 @@ def run(self, server_url: str | None = None) -> tuple:
111115 return global_scores , instance_scores
112116
113117
114- def create_unitxt_yaml (yaml_file , unitxt_recipe , task_name ) :
115- data = {"task" : f" { task_name } " , "include" : "unitxt" , "recipe" : f" { unitxt_recipe } " }
118+ def create_unitxt_yaml (yaml_file : str , unitxt_recipe : str , task_name : str ) -> None :
119+ data = {"task" : task_name , "include" : "unitxt" , "recipe" : unitxt_recipe }
116120 with open (yaml_file , "w" , encoding = "utf-8" ) as file :
117121 yaml .dump (data , file , default_flow_style = False )
118122 logger .debug ("task %s unitxt recipe written to %s" , task_name , yaml_file )
0 commit comments