remove restarts + handle empty df
Browse files
app.py
CHANGED
|
@@ -33,6 +33,7 @@ def restart_space():
|
|
| 33 |
API.restart_space(repo_id=REPO_ID)
|
| 34 |
|
| 35 |
### Space initialisation
|
|
|
|
| 36 |
try:
|
| 37 |
print(EVAL_REQUESTS_PATH)
|
| 38 |
snapshot_download(
|
|
@@ -47,7 +48,7 @@ try:
|
|
| 47 |
)
|
| 48 |
except Exception:
|
| 49 |
restart_space()
|
| 50 |
-
|
| 51 |
|
| 52 |
LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
| 53 |
|
|
@@ -58,8 +59,8 @@ LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS,
|
|
| 58 |
) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
| 59 |
|
| 60 |
def init_leaderboard(dataframe):
|
| 61 |
-
if dataframe is None or dataframe.empty:
|
| 62 |
-
raise ValueError("Leaderboard DataFrame is empty or None.")
|
| 63 |
return Leaderboard(
|
| 64 |
value=dataframe,
|
| 65 |
datatype=[c.type for c in fields(AutoEvalColumn)],
|
|
|
|
| 33 |
API.restart_space(repo_id=REPO_ID)
|
| 34 |
|
| 35 |
### Space initialisation
|
| 36 |
+
"""
|
| 37 |
try:
|
| 38 |
print(EVAL_REQUESTS_PATH)
|
| 39 |
snapshot_download(
|
|
|
|
| 48 |
)
|
| 49 |
except Exception:
|
| 50 |
restart_space()
|
| 51 |
+
"""
|
| 52 |
|
| 53 |
LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
| 54 |
|
|
|
|
| 59 |
) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
| 60 |
|
| 61 |
def init_leaderboard(dataframe):
|
| 62 |
+
#if dataframe is None or dataframe.empty:
|
| 63 |
+
#raise ValueError("Leaderboard DataFrame is empty or None.")
|
| 64 |
return Leaderboard(
|
| 65 |
value=dataframe,
|
| 66 |
datatype=[c.type for c in fields(AutoEvalColumn)],
|