Spaces:
Running
on
Zero
Running
on
Zero
token usage from admin
Browse files
app.py
CHANGED
|
@@ -762,7 +762,8 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 762 |
try:
|
| 763 |
profile = whoami(token=token.token)
|
| 764 |
username = profile["name"]
|
| 765 |
-
|
|
|
|
| 766 |
# Only check if user played today if BLOCK_MULTIPLE_GAMES is enabled
|
| 767 |
has_played = data_manager.BLOCK_MULTIPLE_GAMES and data_manager.has_user_played_today(username, todays_games)
|
| 768 |
except Exception as e:
|
|
|
|
| 762 |
try:
|
| 763 |
profile = whoami(token=token.token)
|
| 764 |
username = profile["name"]
|
| 765 |
+
# Use server token to read the dataset, not user's token
|
| 766 |
+
todays_games = data_manager.get_todays_games(token=SERVER_HF_TOKEN)
|
| 767 |
# Only check if user played today if BLOCK_MULTIPLE_GAMES is enabled
|
| 768 |
has_played = data_manager.BLOCK_MULTIPLE_GAMES and data_manager.has_user_played_today(username, todays_games)
|
| 769 |
except Exception as e:
|