Fix run time error for Check my progress Audio (app.py)

#5
by thuyentruong - opened
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -203,13 +203,15 @@ def certification(hf_username):
203
  unit["passed"] = pass_emoji(unit["passed_"])
204
  except: print("Either no relevant models found, or no metrics in the model card for automatic speech recognition")
205
  case "demo":
206
- u7_usernames = hf_hub_download(USERNAMES_DATASET_ID, repo_type = "dataset", filename="usernames.csv", token=HF_TOKEN)
207
- u7_users = pd.read_csv(u7_usernames)
208
- if hf_username in u7_users['username'].tolist():
209
- unit["best_result"] = 0
210
- unit["best_model_id"] = "Demo check passed, no model id"
211
- unit["passed_"] = True
212
- unit["passed"] = pass_emoji(unit["passed_"])
 
 
213
  case _:
214
  print("Unknown task")
215
 
 
203
  unit["passed"] = pass_emoji(unit["passed_"])
204
  except: print("Either no relevant models found, or no metrics in the model card for automatic speech recognition")
205
  case "demo":
206
+ try:
207
+ u7_usernames = hf_hub_download(USERNAMES_DATASET_ID, repo_type = "dataset", filename="usernames.csv", token=HF_TOKEN)
208
+ u7_users = pd.read_csv(u7_usernames)
209
+ if hf_username in u7_users['username'].tolist():
210
+ unit["best_result"] = 0
211
+ unit["best_model_id"] = "Demo check passed, no model id"
212
+ unit["passed_"] = True
213
+ unit["passed"] = pass_emoji(unit["passed_"])
214
+ except: print("Either no relevant models found, or no metrics in the model card for demo")
215
  case _:
216
  print("Unknown task")
217