elif instead of if
Browse files
app.py
CHANGED
|
@@ -179,7 +179,7 @@ def commit(repo, pr_number=None, message="Adding Evaluation Results", oauth_toke
|
|
| 179 |
if oauth_token is None:
|
| 180 |
gr.Warning("You are not logged in; therefore, the leaderboard-pr-bot will open the pull request instead of you. Click on 'Sign in with Huggingface' to log in.")
|
| 181 |
token = BOT_HF_TOKEN
|
| 182 |
-
|
| 183 |
raise gr.Error("Token expired. Logout and try again.")
|
| 184 |
token = token if token else oauth_token.token
|
| 185 |
|
|
|
|
| 179 |
if oauth_token is None:
|
| 180 |
gr.Warning("You are not logged in; therefore, the leaderboard-pr-bot will open the pull request instead of you. Click on 'Sign in with Huggingface' to log in.")
|
| 181 |
token = BOT_HF_TOKEN
|
| 182 |
+
elif oauth_token.expires_at < time.time():
|
| 183 |
raise gr.Error("Token expired. Logout and try again.")
|
| 184 |
token = token if token else oauth_token.token
|
| 185 |
|