SushantGautam commited on
Commit
00aad64
·
1 Parent(s): a92924f

Ensure hub_path directory exists before listing downloaded submissions

Browse files
Files changed (1) hide show
  1. gradio_interface.py +2 -0
gradio_interface.py CHANGED
@@ -23,6 +23,8 @@ def refresh_submissions():
23
  hub_path = snapshot_download(repo_type="dataset",
24
  repo_id=SUBMISSION_REPO, allow_patterns=['*.json'])
25
  print("Downloaded submissions to: ", hub_path)
 
 
26
  print("os.listdir(hub_path):", os.listdir(hub_path))
27
  json_files = [f for f in os.listdir(hub_path) if f.endswith('.json')]
28
  print("Downloaded submissions: ", json_files)
 
23
  hub_path = snapshot_download(repo_type="dataset",
24
  repo_id=SUBMISSION_REPO, allow_patterns=['*.json'])
25
  print("Downloaded submissions to: ", hub_path)
26
+ if not os.path.exists(hub_path):
27
+ os.makedirs(hub_path) # empty repo case
28
  print("os.listdir(hub_path):", os.listdir(hub_path))
29
  json_files = [f for f in os.listdir(hub_path) if f.endswith('.json')]
30
  print("Downloaded submissions: ", json_files)