Spaces:
Sleeping
Sleeping
Download auth_utils.py from VizWiz-Challenges/evaluationServer: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/spaces/VizWiz-Challenges/evaluationServer/resolve/main/auth_utils.py
- Command line
-
hf download hf://spaces/VizWiz-Challenges/evaluationServer/auth_utils.py
-
curl -L -o auth_utils.py https://huggingface.co/spaces/VizWiz-Challenges/evaluationServer/resolve/main/auth_utils.py
770 Bytes
| import gradio as gr | |
| from hf_utils import _count_submissions_today, _get_cap_for_phase | |
| def get_user_greeting(profile: gr.OAuthProfile | None) -> str: | |
| if profile is None: | |
| return "👋 Log in with your HuggingFace account to submit predictions." | |
| return f"👤 Logged in as **{profile.username}**" | |
| def get_daily_cap_info(profile: gr.OAuthProfile | None, phases: list = None) -> str: | |
| if profile is None: | |
| return "" | |
| lines = [] | |
| for p in phases or []: | |
| cap = _get_cap_for_phase(p["codename"]) | |
| used = _count_submissions_today(profile.username, p["codename"]) | |
| remaining = cap - used | |
| lines.append(f"**{p['label'].split('(')[0].strip()}:** {remaining}/{cap} remaining") | |
| return " \n".join(lines) | |