Spaces:
Runtime error
Runtime error
Split username from model name
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def download_submissions():
|
|
42 |
|
43 |
|
44 |
def format_submissions(submissions):
|
45 |
-
submission_data = {**{"
|
46 |
|
47 |
# TODO(lewtun): delete / filter all the junk repos from development
|
48 |
# The following picks the latest submissions which adhere to the model card schema
|
@@ -55,12 +55,12 @@ def format_submissions(submissions):
|
|
55 |
data = response.json()
|
56 |
card_data = data["card_data"]
|
57 |
username = card_data["submission_dataset"].split("/")[0]
|
|
|
58 |
submission_id = card_data["submission_id"]
|
59 |
submission_name, sha, timestamp = submission_id.split("__")
|
60 |
-
|
61 |
-
submission_data["Submission"].append(submission)
|
62 |
timestamp = pd.to_datetime(int(timestamp))
|
63 |
-
submission_data["
|
64 |
|
65 |
for task in card_data["results"]:
|
66 |
task_data = task["task"]
|
@@ -69,7 +69,7 @@ def format_submissions(submissions):
|
|
69 |
submission_data[task_name].append(score)
|
70 |
|
71 |
df = pd.DataFrame(submission_data)
|
72 |
-
df.insert(
|
73 |
df = df.copy().sort_values("Overall", ascending=False)
|
74 |
df.rename(columns={k: v for k, v in zip(TASKS, FORMATTED_TASK_NAMES)}, inplace=True)
|
75 |
# Start ranking from 1
|
|
|
42 |
|
43 |
|
44 |
def format_submissions(submissions):
|
45 |
+
submission_data = {**{"Team": []}, **{"Model": []}, **{"Date": []}, **{t: [] for t in TASKS}}
|
46 |
|
47 |
# TODO(lewtun): delete / filter all the junk repos from development
|
48 |
# The following picks the latest submissions which adhere to the model card schema
|
|
|
55 |
data = response.json()
|
56 |
card_data = data["card_data"]
|
57 |
username = card_data["submission_dataset"].split("/")[0]
|
58 |
+
submission_data["Team"].append(username)
|
59 |
submission_id = card_data["submission_id"]
|
60 |
submission_name, sha, timestamp = submission_id.split("__")
|
61 |
+
submission_data["Model"].append(submission_name)
|
|
|
62 |
timestamp = pd.to_datetime(int(timestamp))
|
63 |
+
submission_data["Date"].append(datetime.date(timestamp).strftime("%b %d, %Y"))
|
64 |
|
65 |
for task in card_data["results"]:
|
66 |
task_data = task["task"]
|
|
|
69 |
submission_data[task_name].append(score)
|
70 |
|
71 |
df = pd.DataFrame(submission_data)
|
72 |
+
df.insert(3, "Overall", df[TASKS].mean(axis=1))
|
73 |
df = df.copy().sort_values("Overall", ascending=False)
|
74 |
df.rename(columns={k: v for k, v in zip(TASKS, FORMATTED_TASK_NAMES)}, inplace=True)
|
75 |
# Start ranking from 1
|