File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2020
2121logger = setup_logger (__name__ )
2222
23+ TEMP_DIR_PREFIX = 'unitxt_temp'
24+
2325class UnitxtEvaluator (MMLUBranchEvaluator ):
2426 """
2527 An evaluator class, running Unitxt evaluation
@@ -47,17 +49,17 @@ def __init__(
4749
4850 def prepare_unitxt_files (self , unitxt_recipe )-> tuple :
4951 temp_task = str (uuid4 ())
50- temp_tasks_dir = f'unitxt_temp_ { temp_task } '
52+ temp_tasks_dir = f'{ TEMP_DIR_PREFIX } _ { temp_task } '
5153 yaml_file = os .path .join (temp_tasks_dir ,f"{ temp_task } .yaml" )
5254 create_unitxt_pointer (temp_tasks_dir )
5355 create_unitxt_yaml (yaml_file = yaml_file , unitxt_recipe = unitxt_recipe , task_name = temp_task )
5456 return temp_task ,temp_tasks_dir
5557
5658 def remove_temp_files (self ):
57- if self .tasks_dir .startswith ('temp_' ): #to avoid unintended deletion if this class is inherited
59+ if self .tasks_dir .startswith (TEMP_DIR_PREFIX ): #to avoid unintended deletion if this class is inherited
5860 shutil .rmtree (self .tasks_dir )
5961 else :
60- logger .warning ("unitxt tasks dir did not start with 'temp_ ' and therefor was not deleted" )
62+ logger .warning (f "unitxt tasks dir did not start with '{ TEMP_DIR_PREFIX } ' and therefor was not deleted" )
6163
6264 def run (self ,server_url : str | None = None ) -> tuple :
6365 """
You can’t perform that action at this time.
0 commit comments