Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Fix Space startup and reduce restart churn
Browse files- app.py +0 -7
- requirements.txt +2 -2
app.py
CHANGED
|
@@ -9,7 +9,6 @@ import pandas as pd
|
|
| 9 |
import numpy as np
|
| 10 |
|
| 11 |
from datasets import load_dataset, VerificationMode
|
| 12 |
-
from apscheduler.schedulers.background import BackgroundScheduler
|
| 13 |
from huggingface_hub import HfApi
|
| 14 |
|
| 15 |
# InfoStrings
|
|
@@ -69,9 +68,6 @@ gold_dataset = load_dataset(INTERNAL_DATA_DATASET, f"{YEAR_VERSION}_all", token=
|
|
| 69 |
gold_results = {split: {row["task_id"]: row for row in gold_dataset[split]} for split in ["test", "validation"]}
|
| 70 |
|
| 71 |
|
| 72 |
-
def restart_space():
|
| 73 |
-
api.restart_space(repo_id=LEADERBOARD_PATH, token=TOKEN)
|
| 74 |
-
|
| 75 |
TYPES = ["markdown", "number", "number", "number", "number", "str", "str", "str"]
|
| 76 |
|
| 77 |
def add_new_eval(
|
|
@@ -329,7 +325,4 @@ with demo:
|
|
| 329 |
submission_result,
|
| 330 |
)
|
| 331 |
|
| 332 |
-
scheduler = BackgroundScheduler()
|
| 333 |
-
scheduler.add_job(restart_space, "interval", seconds=3600)
|
| 334 |
-
scheduler.start()
|
| 335 |
demo.launch(debug=True)
|
|
|
|
| 9 |
import numpy as np
|
| 10 |
|
| 11 |
from datasets import load_dataset, VerificationMode
|
|
|
|
| 12 |
from huggingface_hub import HfApi
|
| 13 |
|
| 14 |
# InfoStrings
|
|
|
|
| 68 |
gold_results = {split: {row["task_id"]: row for row in gold_dataset[split]} for split in ["test", "validation"]}
|
| 69 |
|
| 70 |
|
|
|
|
|
|
|
|
|
|
| 71 |
TYPES = ["markdown", "number", "number", "number", "number", "str", "str", "str"]
|
| 72 |
|
| 73 |
def add_new_eval(
|
|
|
|
| 325 |
submission_result,
|
| 326 |
)
|
| 327 |
|
|
|
|
|
|
|
|
|
|
| 328 |
demo.launch(debug=True)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
datasets
|
| 2 |
-
gradio==5.49.1
|
| 3 |
huggingface-hub
|
| 4 |
numpy
|
| 5 |
-
|
|
|
|
| 1 |
datasets
|
| 2 |
+
gradio[oauth]==5.49.1
|
| 3 |
huggingface-hub
|
| 4 |
numpy
|
| 5 |
+
pandas
|