Skip to content

Commit 2fea800

Browse files
committed
temp dir prefix
Signed-off-by: Roni Friedman-Melamed <[email protected]>
1 parent 5c2dee4 commit 2fea800

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/instructlab/eval/unitxt.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
logger = setup_logger(__name__)
2222

23+
TEMP_DIR_PREFIX = 'unitxt_temp'
24+
2325
class 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
"""

0 commit comments

Comments
 (0)