Spaces:
Running
Running
Commit
·
ea9b1ca
1
Parent(s):
63b28b4
two space compatability
Browse files
app.py
CHANGED
@@ -8,12 +8,19 @@ import logging
|
|
8 |
import os
|
9 |
|
10 |
logging.basicConfig(level=logging.INFO)
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
LAST_UPDATED = "Dec 4th 2024"
|
13 |
|
14 |
def load_leaderboard_data():
|
15 |
try:
|
16 |
response = requests.get(f"{QUEUE_SPACE_URL}/api/leaderboard")
|
|
|
17 |
response.raise_for_status()
|
18 |
return pd.DataFrame(response.json())
|
19 |
except requests.RequestException as e:
|
@@ -51,6 +58,7 @@ def submit_evaluation(model_name, submission_name, github_url):
|
|
51 |
|
52 |
try:
|
53 |
response = requests.post(f"{QUEUE_SPACE_URL}/api/evaluate", json=request_data)
|
|
|
54 |
response.raise_for_status()
|
55 |
task_id = response.json()["task_id"]
|
56 |
return f"✅ Evaluation submitted successfully! Task ID: {task_id}"
|
@@ -62,6 +70,7 @@ def check_task_status(task_id):
|
|
62 |
return "Please enter a task ID"
|
63 |
try:
|
64 |
response = requests.get(f"{QUEUE_SPACE_URL}/api/tasks/{task_id}")
|
|
|
65 |
response.raise_for_status()
|
66 |
return response.json()
|
67 |
except requests.RequestException as e:
|
|
|
8 |
import os
|
9 |
|
10 |
logging.basicConfig(level=logging.INFO)
|
11 |
+
|
12 |
+
# Update URL format for HuggingFace Spaces
|
13 |
+
QUEUE_SPACE_URL = os.getenv(
|
14 |
+
'QUEUE_SPACE_URL',
|
15 |
+
'https://koellabs-ipa-transcription-en-queue.hf.space'
|
16 |
+
).rstrip('/')
|
17 |
+
|
18 |
LAST_UPDATED = "Dec 4th 2024"
|
19 |
|
20 |
def load_leaderboard_data():
|
21 |
try:
|
22 |
response = requests.get(f"{QUEUE_SPACE_URL}/api/leaderboard")
|
23 |
+
logging.info(f"Leaderboard request URL: {QUEUE_SPACE_URL}/api/leaderboard")
|
24 |
response.raise_for_status()
|
25 |
return pd.DataFrame(response.json())
|
26 |
except requests.RequestException as e:
|
|
|
58 |
|
59 |
try:
|
60 |
response = requests.post(f"{QUEUE_SPACE_URL}/api/evaluate", json=request_data)
|
61 |
+
logging.info(f"Submit request URL: {QUEUE_SPACE_URL}/api/evaluate")
|
62 |
response.raise_for_status()
|
63 |
task_id = response.json()["task_id"]
|
64 |
return f"✅ Evaluation submitted successfully! Task ID: {task_id}"
|
|
|
70 |
return "Please enter a task ID"
|
71 |
try:
|
72 |
response = requests.get(f"{QUEUE_SPACE_URL}/api/tasks/{task_id}")
|
73 |
+
logging.info(f"Status check URL: {QUEUE_SPACE_URL}/api/tasks/{task_id}")
|
74 |
response.raise_for_status()
|
75 |
return response.json()
|
76 |
except requests.RequestException as e:
|