Spaces:
Runtime error
Runtime error
Commit
·
492102c
1
Parent(s):
b7b1ce5
fix_pathing
Browse files
app.py
CHANGED
|
@@ -120,7 +120,8 @@ def upload_file(file, model_name, username, link):
|
|
| 120 |
|
| 121 |
current_info.append(submit_info)
|
| 122 |
|
| 123 |
-
|
|
|
|
| 124 |
submit_meta_file.write(json.dumps(current_info))
|
| 125 |
logging.info(
|
| 126 |
"New submition: file from %s saved to %s with model %s",
|
|
@@ -129,14 +130,14 @@ def upload_file(file, model_name, username, link):
|
|
| 129 |
model_name,
|
| 130 |
)
|
| 131 |
API.upload_file(
|
| 132 |
-
path_or_fileobj=file.name,
|
| 133 |
path_in_repo="arena-hard-v0.1/model_answers/" + file_name,
|
|
|
|
| 134 |
repo_id=METAINFO_DATASET,
|
| 135 |
repo_type="dataset",
|
| 136 |
token=HF_TOKEN_PRIVATE,
|
| 137 |
)
|
| 138 |
API.upload_file(
|
| 139 |
-
path_or_fileobj=
|
| 140 |
path_in_repo=SUBMITS_META_FILE,
|
| 141 |
repo_id=METAINFO_DATASET,
|
| 142 |
repo_type="dataset",
|
|
|
|
| 120 |
|
| 121 |
current_info.append(submit_info)
|
| 122 |
|
| 123 |
+
local_submits_path = f"{DATA_PATH}/{SUBMITS_META_FILE}"
|
| 124 |
+
with open(local_submits_path, "w", encoding="utf-8") as submit_meta_file:
|
| 125 |
submit_meta_file.write(json.dumps(current_info))
|
| 126 |
logging.info(
|
| 127 |
"New submition: file from %s saved to %s with model %s",
|
|
|
|
| 130 |
model_name,
|
| 131 |
)
|
| 132 |
API.upload_file(
|
|
|
|
| 133 |
path_in_repo="arena-hard-v0.1/model_answers/" + file_name,
|
| 134 |
+
path_or_fileobj=file_name,
|
| 135 |
repo_id=METAINFO_DATASET,
|
| 136 |
repo_type="dataset",
|
| 137 |
token=HF_TOKEN_PRIVATE,
|
| 138 |
)
|
| 139 |
API.upload_file(
|
| 140 |
+
path_or_fileobj=local_submits_path,
|
| 141 |
path_in_repo=SUBMITS_META_FILE,
|
| 142 |
repo_id=METAINFO_DATASET,
|
| 143 |
repo_type="dataset",
|