Spaces:
Running
Running
Jae-Won Chung
commited on
Commit
·
1fc38bc
1
Parent(s):
dcc2472
Convert date to ET
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import yaml
|
|
| 5 |
import requests
|
| 6 |
import itertools
|
| 7 |
import contextlib
|
|
|
|
| 8 |
|
| 9 |
import numpy as np
|
| 10 |
import gradio as gr
|
|
@@ -228,7 +229,8 @@ if resp.status_code != 200:
|
|
| 228 |
print("Failed to fetch the latest release date of the leaderboard repository.")
|
| 229 |
print(resp.json())
|
| 230 |
else:
|
| 231 |
-
|
|
|
|
| 232 |
|
| 233 |
# Custom JS.
|
| 234 |
# XXX: This is a hack to make the model names clickable.
|
|
@@ -416,7 +418,7 @@ with block:
|
|
| 416 |
|
| 417 |
# Block 5: Leaderboard date.
|
| 418 |
with gr.Row():
|
| 419 |
-
gr.HTML(f"<h3 style='color: gray'>
|
| 420 |
|
| 421 |
# Tab 2: About page.
|
| 422 |
with gr.TabItem("About"):
|
|
|
|
| 5 |
import requests
|
| 6 |
import itertools
|
| 7 |
import contextlib
|
| 8 |
+
from dateutil import parser, tz
|
| 9 |
|
| 10 |
import numpy as np
|
| 11 |
import gradio as gr
|
|
|
|
| 229 |
print("Failed to fetch the latest release date of the leaderboard repository.")
|
| 230 |
print(resp.json())
|
| 231 |
else:
|
| 232 |
+
current_datetime = parser.parse(resp.json()["commit"]["author"]["date"])
|
| 233 |
+
current_date = current_datetime.astimezone(tz.gettz("US/Eastern")).strftime("%Y-%m-%d")
|
| 234 |
|
| 235 |
# Custom JS.
|
| 236 |
# XXX: This is a hack to make the model names clickable.
|
|
|
|
| 418 |
|
| 419 |
# Block 5: Leaderboard date.
|
| 420 |
with gr.Row():
|
| 421 |
+
gr.HTML(f"<h3 style='color: gray'>Last updated: {current_date}</h3>")
|
| 422 |
|
| 423 |
# Tab 2: About page.
|
| 424 |
with gr.TabItem("About"):
|