Commit
·
0495bc2
1
Parent(s):
6fd0cfa
fix: Do not update last_fetch if nothing in dropdowns
Browse files
app.py
CHANGED
|
@@ -490,12 +490,6 @@ def update_model_ids_dropdown(
|
|
| 490 |
Returns:
|
| 491 |
The Gradio update to the model ids dropdown.
|
| 492 |
"""
|
| 493 |
-
global last_fetch
|
| 494 |
-
minutes_since_last_fetch = (dt.datetime.now() - last_fetch).total_seconds() / 60
|
| 495 |
-
if minutes_since_last_fetch > UPDATE_FREQUENCY_MINUTES:
|
| 496 |
-
results_dfs = fetch_results()
|
| 497 |
-
last_fetch = dt.datetime.now()
|
| 498 |
-
|
| 499 |
if results_dfs is None or len(language_names) == 0:
|
| 500 |
if results_dfs is None:
|
| 501 |
logger.info("No results fetched yet. Resetting model ids dropdown.")
|
|
@@ -503,6 +497,12 @@ def update_model_ids_dropdown(
|
|
| 503 |
logger.info("No languages selected. Resetting model ids dropdown.")
|
| 504 |
return gr.update(choices=[], value=[])
|
| 505 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 506 |
tasks = [
|
| 507 |
task
|
| 508 |
for task in ALL_TASKS
|
|
@@ -587,12 +587,6 @@ def produce_radial_plot(
|
|
| 587 |
Returns:
|
| 588 |
A plotly figure.
|
| 589 |
"""
|
| 590 |
-
global last_fetch
|
| 591 |
-
minutes_since_last_fetch = (dt.datetime.now() - last_fetch).total_seconds() / 60
|
| 592 |
-
if minutes_since_last_fetch > UPDATE_FREQUENCY_MINUTES:
|
| 593 |
-
results_dfs = fetch_results()
|
| 594 |
-
last_fetch = dt.datetime.now()
|
| 595 |
-
|
| 596 |
if results_dfs is None or len(language_names) == 0 or len(model_ids) == 0:
|
| 597 |
if results_dfs is None:
|
| 598 |
logger.info("No results fetched yet. Resetting plot.")
|
|
@@ -602,6 +596,12 @@ def produce_radial_plot(
|
|
| 602 |
logger.info("No models selected. Resetting plot.")
|
| 603 |
return go.Figure()
|
| 604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 605 |
logger.info(
|
| 606 |
f"Producing radial plot for models {model_ids!r} on languages "
|
| 607 |
f"{language_names!r}..."
|
|
|
|
| 490 |
Returns:
|
| 491 |
The Gradio update to the model ids dropdown.
|
| 492 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 493 |
if results_dfs is None or len(language_names) == 0:
|
| 494 |
if results_dfs is None:
|
| 495 |
logger.info("No results fetched yet. Resetting model ids dropdown.")
|
|
|
|
| 497 |
logger.info("No languages selected. Resetting model ids dropdown.")
|
| 498 |
return gr.update(choices=[], value=[])
|
| 499 |
|
| 500 |
+
global last_fetch
|
| 501 |
+
minutes_since_last_fetch = (dt.datetime.now() - last_fetch).total_seconds() / 60
|
| 502 |
+
if minutes_since_last_fetch > UPDATE_FREQUENCY_MINUTES:
|
| 503 |
+
results_dfs = fetch_results()
|
| 504 |
+
last_fetch = dt.datetime.now()
|
| 505 |
+
|
| 506 |
tasks = [
|
| 507 |
task
|
| 508 |
for task in ALL_TASKS
|
|
|
|
| 587 |
Returns:
|
| 588 |
A plotly figure.
|
| 589 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
if results_dfs is None or len(language_names) == 0 or len(model_ids) == 0:
|
| 591 |
if results_dfs is None:
|
| 592 |
logger.info("No results fetched yet. Resetting plot.")
|
|
|
|
| 596 |
logger.info("No models selected. Resetting plot.")
|
| 597 |
return go.Figure()
|
| 598 |
|
| 599 |
+
global last_fetch
|
| 600 |
+
minutes_since_last_fetch = (dt.datetime.now() - last_fetch).total_seconds() / 60
|
| 601 |
+
if minutes_since_last_fetch > UPDATE_FREQUENCY_MINUTES:
|
| 602 |
+
results_dfs = fetch_results()
|
| 603 |
+
last_fetch = dt.datetime.now()
|
| 604 |
+
|
| 605 |
logger.info(
|
| 606 |
f"Producing radial plot for models {model_ids!r} on languages "
|
| 607 |
f"{language_names!r}..."
|