abhinav-joshi
commited on
Commit
•
741eae9
1
Parent(s):
9a20624
fix upload
Browse files- uploads.py +12 -2
uploads.py
CHANGED
@@ -4,7 +4,7 @@ import os
|
|
4 |
import datetime
|
5 |
import pandas as pd
|
6 |
|
7 |
-
|
8 |
RESULTS_PATH = "Exploration-Lab/IL-TUR-Leaderboard-results"
|
9 |
api = HfApi()
|
10 |
TOKEN = os.environ.get("TOKEN", None)
|
@@ -99,7 +99,17 @@ def add_new_eval(
|
|
99 |
leaderboard_df = leaderboard_df.append(submission_df)
|
100 |
|
101 |
# save the new leaderboard
|
102 |
-
leaderboard_df.to_csv(f"submissions/baseline/baseline.csv", index=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
return format_log(
|
105 |
f"Method {method_name} submitted by {organisation} successfully. \nPlease refresh the leaderboard, and wait a bit to see the score displayed"
|
|
|
4 |
import datetime
|
5 |
import pandas as pd
|
6 |
|
7 |
+
LEADERBOARD_PATH = "Exploration-Lab/IL-TUR-Leaderboard"
|
8 |
RESULTS_PATH = "Exploration-Lab/IL-TUR-Leaderboard-results"
|
9 |
api = HfApi()
|
10 |
TOKEN = os.environ.get("TOKEN", None)
|
|
|
99 |
leaderboard_df = leaderboard_df.append(submission_df)
|
100 |
|
101 |
# save the new leaderboard
|
102 |
+
# leaderboard_df.to_csv(f"submissions/baseline/baseline.csv", index=False)
|
103 |
+
leaderboard_buffer = io.BytesIO()
|
104 |
+
leaderboard_df.to_csv(leaderboard_buffer, index=False)
|
105 |
+
leaderboard_buffer.seek(0)
|
106 |
+
api.upload_file(
|
107 |
+
repo_id=RESULTS_PATH,
|
108 |
+
path_in_repo=f"submissions/baseline/baseline.csv",
|
109 |
+
path_or_fileobj=leaderboard_buffer,
|
110 |
+
token=TOKEN,
|
111 |
+
repo_type="dataset",
|
112 |
+
)
|
113 |
|
114 |
return format_log(
|
115 |
f"Method {method_name} submitted by {organisation} successfully. \nPlease refresh the leaderboard, and wait a bit to see the score displayed"
|