File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -645,9 +645,25 @@ def model_post_init(self, __context: Any) -> None:
645645 task_file = os .path .join (self .test_set_path , f"examples/{ domain } /{ task_id } .json" )
646646 with open (task_file ) as f :
647647 task = json .load (f )
648+ task = self .fix_settings_file_path_in_config (task )
648649 name = f"{ self .name } .{ task ['id' ]} "
649650 task_env_args = deepcopy (self .env_args )
650651 task_env_args .task = task
651652 task_env_args .task_name = name
652653 self .env_args_list .append (task_env_args )
653654 logger .info (f"Loaded { len (self .env_args_list )} tasks from domain '{ self .domain } '" )
655+
656+ def fix_settings_file_path_in_config (self , task ) -> str :
657+ """Fix the settings file path in the task configuration.
658+ #TODO: We can create our own tiny_osworld.json with correct paths (OSWorld prefixed) to settings files. Meanwhile use this function to fix the paths.
659+ """
660+ osworld_repo = os .getenv ("OSWORLD_REPO" , "OSWorld" )
661+ updated_task = deepcopy (task ) # Avoid modifying the original task
662+ for config in updated_task ["config" ]:
663+ if config .get ("parameters" , False ) and config ["parameters" ].get (
664+ "settings_file" , False
665+ ):
666+ config ["parameters" ]["settings_file" ] = os .path .join (
667+ osworld_repo , config ["parameters" ]["settings_file" ]
668+ )
669+ return updated_task
You can’t perform that action at this time.
0 commit comments