Spaces:
Sleeping
Sleeping
Clémentine
commited on
Commit
·
2a8dc61
1
Parent(s):
51ba542
simplify save
Browse files- app.py +5 -3
- globals.py +1 -1
app.py
CHANGED
|
@@ -55,8 +55,8 @@ def create_app() -> gr.Blocks:
|
|
| 55 |
show_copy_button=True,
|
| 56 |
show_fullscreen_button=True,
|
| 57 |
wrap=True,
|
| 58 |
-
static_columns=list(range(
|
| 59 |
-
datatype=["str", "str", "str", "str", "str", "str", "html", "str"],
|
| 60 |
elem_id="results_table"
|
| 61 |
)
|
| 62 |
|
|
@@ -88,7 +88,7 @@ def create_app() -> gr.Blocks:
|
|
| 88 |
print(f"[Relaunch] Cell selected - Row: {evt.index[0]}, Col: {evt.index[1]}, Value: {evt.value}")
|
| 89 |
|
| 90 |
# If we selected a "rerun" cell, we relaunch a job
|
| 91 |
-
if evt.index[1] ==
|
| 92 |
# Get the full row data from the dataframe
|
| 93 |
df = get_results_table()
|
| 94 |
row_data = df.data.iloc[evt.index[0]]
|
|
@@ -98,6 +98,8 @@ def create_app() -> gr.Blocks:
|
|
| 98 |
print(f"[Relaunch] Relaunching job - Model: {model}, Provider: {provider}")
|
| 99 |
|
| 100 |
run_single_job(model, provider, globals.TASKS)
|
|
|
|
|
|
|
| 101 |
|
| 102 |
# Then update the table
|
| 103 |
return get_results_table()
|
|
|
|
| 55 |
show_copy_button=True,
|
| 56 |
show_fullscreen_button=True,
|
| 57 |
wrap=True,
|
| 58 |
+
static_columns=list(range(9)),
|
| 59 |
+
datatype=["str", "str", "str", "str", "str", "str", "str", "str", "html", "str"],
|
| 60 |
elem_id="results_table"
|
| 61 |
)
|
| 62 |
|
|
|
|
| 88 |
print(f"[Relaunch] Cell selected - Row: {evt.index[0]}, Col: {evt.index[1]}, Value: {evt.value}")
|
| 89 |
|
| 90 |
# If we selected a "rerun" cell, we relaunch a job
|
| 91 |
+
if evt.index[1] == 9:
|
| 92 |
# Get the full row data from the dataframe
|
| 93 |
df = get_results_table()
|
| 94 |
row_data = df.data.iloc[evt.index[0]]
|
|
|
|
| 98 |
print(f"[Relaunch] Relaunching job - Model: {model}, Provider: {provider}")
|
| 99 |
|
| 100 |
run_single_job(model, provider, globals.TASKS)
|
| 101 |
+
# Save after individual relaunch
|
| 102 |
+
save_results()
|
| 103 |
|
| 104 |
# Then update the table
|
| 105 |
return get_results_table()
|
globals.py
CHANGED
|
@@ -4,7 +4,7 @@ import threading
|
|
| 4 |
from typing import Dict, Any, Optional
|
| 5 |
|
| 6 |
# Type definition for job result entries
|
| 7 |
-
JobResult = Dict[str, Any] # {model, provider, last_run, status, current_score, previous_score, job_id}
|
| 8 |
|
| 9 |
# Global variables to track jobs
|
| 10 |
job_results: Dict[str, JobResult] = {} # {model_provider_key: JobResult}
|
|
|
|
| 4 |
from typing import Dict, Any, Optional
|
| 5 |
|
| 6 |
# Type definition for job result entries
|
| 7 |
+
JobResult = Dict[str, Any] # {model, provider, last_run, status, current_score, previous_score, job_id, start_time, duration, completed_at}
|
| 8 |
|
| 9 |
# Global variables to track jobs
|
| 10 |
job_results: Dict[str, JobResult] = {} # {model_provider_key: JobResult}
|