Commit ·
0f1f754
1
Parent(s): 0c55f72
Fetch usernames for U7 each time space is called (#1)
Browse files- Fetch usernames for U7 each time space is called (5ca15993e267476ab1ee751b29310eb647e26300)
Co-authored-by: Sanchit Gandhi <sanchit-gandhi@users.noreply.huggingface.co>
17 unmodified lines18192021212223176 unmodified lines20020120220320420420520620717 unmodified linesapi = HfApi()USERNAMES_DATASET_ID = "huggingface-course/audio-course-u7-hands-on"HF_TOKEN = os.environ.get("HF_TOKEN")U7_USERNAMES = hf_hub_download(USERNAMES_DATASET_ID, repo_type = "dataset", filename="usernames.csv", token=HF_TOKEN)
def get_user_models(hf_username, task):176 unmodified lines unit["passed"] = pass_emoji(unit["passed_"]) except: print("Either no relevant models found, or no metrics in the model card for automatic speech recognition") case "demo": u7_usernames = hf_hub_download(USERNAMES_DATASET_ID, repo_type = "dataset", filename="usernames.csv", token=HF_TOKEN) u7_users = pd.read_csv(U7_USERNAMES) u7_users = pd.read_csv(u7_usernames) if hf_username in u7_users['username']: unit["best_result"] = 0 unit["best_model_id"] = "Demo check passed, no model id"app.py+2-2