Spaces:
Runtime error
Runtime error
Store each submission as single dataset repo
Browse files- .gitignore +3 -1
- app.py +25 -21
.gitignore
CHANGED
|
@@ -141,4 +141,6 @@ cython_debug/
|
|
| 141 |
.env
|
| 142 |
|
| 143 |
# Submissions
|
| 144 |
-
submission_repo/
|
|
|
|
|
|
|
|
|
| 141 |
.env
|
| 142 |
|
| 143 |
# Submissions
|
| 144 |
+
submission_repo/
|
| 145 |
+
GEM-outputs/
|
| 146 |
+
sample-submissions/
|
app.py
CHANGED
|
@@ -116,9 +116,14 @@ if submit_button and submission_errors == 0:
|
|
| 116 |
st.write("β³ Preparing submission for evaluation ...")
|
| 117 |
user_name = user_info["name"]
|
| 118 |
submission_name = json_data["submission_name"]
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
# Create submission dataset under benchmarks ORG
|
| 121 |
-
dataset_repo_url =
|
|
|
|
|
|
|
| 122 |
repo = Repository(
|
| 123 |
local_dir=LOCAL_REPO,
|
| 124 |
clone_from=dataset_repo_url,
|
|
@@ -139,28 +144,27 @@ if submit_button and submission_errors == 0:
|
|
| 139 |
else:
|
| 140 |
commit_sha = repo.git_head_commit_url().split("/")[-1]
|
| 141 |
|
| 142 |
-
submission_time = str(int(datetime.now().timestamp()))
|
| 143 |
submission_id = submission_name + "__" + commit_sha + "__" + submission_time
|
| 144 |
|
| 145 |
-
payload = {
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
}
|
| 156 |
-
json_resp = http_post(
|
| 157 |
-
|
| 158 |
-
).json()
|
| 159 |
-
|
| 160 |
-
if json_resp["status"] == 1:
|
| 161 |
-
|
| 162 |
-
else:
|
| 163 |
-
|
| 164 |
|
| 165 |
# Flush local repo
|
| 166 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
|
|
|
| 116 |
st.write("β³ Preparing submission for evaluation ...")
|
| 117 |
user_name = user_info["name"]
|
| 118 |
submission_name = json_data["submission_name"]
|
| 119 |
+
submission_name_formatted = submission_name.lower().replace(" ", "-").replace("/", "-")
|
| 120 |
+
print(submission_name_formatted)
|
| 121 |
+
submission_time = str(int(datetime.now().timestamp()))
|
| 122 |
|
| 123 |
# Create submission dataset under benchmarks ORG
|
| 124 |
+
dataset_repo_url = (
|
| 125 |
+
f"https://huggingface.co/datasets/GEM-submissions/{user_name}__{submission_name_formatted}__{submission_time}"
|
| 126 |
+
)
|
| 127 |
repo = Repository(
|
| 128 |
local_dir=LOCAL_REPO,
|
| 129 |
clone_from=dataset_repo_url,
|
|
|
|
| 144 |
else:
|
| 145 |
commit_sha = repo.git_head_commit_url().split("/")[-1]
|
| 146 |
|
|
|
|
| 147 |
submission_id = submission_name + "__" + commit_sha + "__" + submission_time
|
| 148 |
|
| 149 |
+
# payload = {
|
| 150 |
+
# "username": AUTONLP_USERNAME,
|
| 151 |
+
# "dataset": "GEM/references",
|
| 152 |
+
# "task": 1,
|
| 153 |
+
# "model": "gem",
|
| 154 |
+
# "submission_dataset": f"GEM-submissions/{user_name}",
|
| 155 |
+
# "submission_id": submission_id,
|
| 156 |
+
# "col_mapping": {},
|
| 157 |
+
# "split": "test",
|
| 158 |
+
# "config": None,
|
| 159 |
+
# }
|
| 160 |
+
# json_resp = http_post(
|
| 161 |
+
# path="/evaluate/create", payload=payload, token=HF_TOKEN, domain=HF_AUTONLP_BACKEND_API
|
| 162 |
+
# ).json()
|
| 163 |
+
|
| 164 |
+
# if json_resp["status"] == 1:
|
| 165 |
+
# st.success(f"β
Submission {submission_name} was successfully submitted for evaluation!")
|
| 166 |
+
# else:
|
| 167 |
+
# st.error("π Oh noes, there was an error submitting your submission! Please contact the organisers")
|
| 168 |
|
| 169 |
# Flush local repo
|
| 170 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|