arach commited on
Commit
4aaa1c3
·
verified ·
1 Parent(s): c4107fb

Fix HF Jobs result upload path expansion

Browse files
eval/news_summarization/launch_hf_job.py CHANGED
@@ -155,12 +155,14 @@ def main() -> int:
155
  import os
156
  from huggingface_hub import HfApi
157
  api = HfApi(token=os.environ['HF_TOKEN'])
 
 
158
  api.upload_folder(
159
  repo_id='{results_repo_id}',
160
  repo_type='{results_repo_type}',
161
- folder_path='{args.results_path_prefix}/$JOB_ID',
162
- path_in_repo='{args.results_path_prefix}/$JOB_ID',
163
- commit_message='Upload news summarization eval results for $JOB_ID',
164
  )
165
  PY
166
  """
 
155
  import os
156
  from huggingface_hub import HfApi
157
  api = HfApi(token=os.environ['HF_TOKEN'])
158
+ job_id = os.environ['JOB_ID']
159
+ folder_path = f"{args.results_path_prefix}/" + job_id
160
  api.upload_folder(
161
  repo_id='{results_repo_id}',
162
  repo_type='{results_repo_type}',
163
+ folder_path=folder_path,
164
+ path_in_repo=folder_path,
165
+ commit_message=f'Upload news summarization eval results for {{job_id}}',
166
  )
167
  PY
168
  """