Spaces:
Running
Running
Shiyu Zhao
commited on
Commit
·
d30ceda
1
Parent(s):
2f7b0cc
Update space
Browse files
app.py
CHANGED
@@ -221,8 +221,8 @@ def save_submission(submission_data, csv_file):
|
|
221 |
csv_file: The uploaded CSV file object
|
222 |
"""
|
223 |
# Create folder name from model name and team name
|
224 |
-
model_name_clean = sanitize_name(submission_data['
|
225 |
-
team_name_clean = sanitize_name(submission_data['
|
226 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
227 |
|
228 |
# Create folder name: model_name_team_name
|
@@ -259,7 +259,7 @@ def save_submission(submission_data, csv_file):
|
|
259 |
json.dump({
|
260 |
"latest_submission": timestamp,
|
261 |
"status": "pending_review",
|
262 |
-
"method_name": submission_data['
|
263 |
}, f, indent=4)
|
264 |
|
265 |
return submission_id
|
@@ -282,15 +282,15 @@ def update_leaderboard_data(submission_data):
|
|
282 |
|
283 |
# Prepare new row data
|
284 |
new_row = {
|
285 |
-
'Method': submission_data['
|
286 |
-
f'STARK-{submission_data["
|
287 |
-
f'STARK-{submission_data["
|
288 |
-
f'STARK-{submission_data["
|
289 |
-
f'STARK-{submission_data["
|
290 |
}
|
291 |
|
292 |
# Check if method already exists
|
293 |
-
method_mask = df_to_update['Method'] == submission_data['
|
294 |
if method_mask.any():
|
295 |
# Update existing row
|
296 |
for col in new_row:
|
|
|
221 |
csv_file: The uploaded CSV file object
|
222 |
"""
|
223 |
# Create folder name from model name and team name
|
224 |
+
model_name_clean = sanitize_name(submission_data['Method Name'])
|
225 |
+
team_name_clean = sanitize_name(submission_data['Team Name'])
|
226 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
227 |
|
228 |
# Create folder name: model_name_team_name
|
|
|
259 |
json.dump({
|
260 |
"latest_submission": timestamp,
|
261 |
"status": "pending_review",
|
262 |
+
"method_name": submission_data['Method Name']
|
263 |
}, f, indent=4)
|
264 |
|
265 |
return submission_id
|
|
|
282 |
|
283 |
# Prepare new row data
|
284 |
new_row = {
|
285 |
+
'Method': submission_data['Method Name'], # Only use method name in table
|
286 |
+
f'STARK-{submission_data["Dataset"].upper()}_Hit@1': submission_data['results']['hit@1'],
|
287 |
+
f'STARK-{submission_data["Dataset"].upper()}_Hit@5': submission_data['results']['hit@5'],
|
288 |
+
f'STARK-{submission_data["Dataset"].upper()}_R@20': submission_data['results']['recall@20'],
|
289 |
+
f'STARK-{submission_data["Dataset"].upper()}_MRR': submission_data['results']['mrr']
|
290 |
}
|
291 |
|
292 |
# Check if method already exists
|
293 |
+
method_mask = df_to_update['Method'] == submission_data['Method Name']
|
294 |
if method_mask.any():
|
295 |
# Update existing row
|
296 |
for col in new_row:
|