before upload_file
Browse files- src/submission/submit.py +14 -9
src/submission/submit.py
CHANGED
@@ -105,28 +105,33 @@ def add_new_eval(
|
|
105 |
with open(out_path, "w") as f:
|
106 |
f.write(json.dumps(eval_entry))
|
107 |
|
108 |
-
print("Uploading eval file")
|
109 |
-
API.upload_file(
|
110 |
-
path_or_fileobj=out_path,
|
111 |
-
path_in_repo=out_path,
|
112 |
-
repo_id=QUEUE_REPO,
|
113 |
-
repo_type="space",
|
114 |
-
commit_message=f"Add {model} to eval queue",
|
115 |
-
)
|
116 |
|
117 |
##update queue file
|
118 |
-
queue_file =
|
119 |
#append the new entry to the queue file
|
120 |
queue_entries = []
|
121 |
if os.path.exists(queue_file):
|
|
|
122 |
with open(queue_file, "r") as f:
|
123 |
queue_entries = json.load(f)
|
124 |
queue_entries.append(eval_entry)
|
125 |
else:
|
|
|
126 |
queue_entries.append(eval_entry)
|
127 |
with open(queue_file, "w") as f:
|
128 |
json.dump(queue_entries, f, indent=4)
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
|
132 |
|
|
|
105 |
with open(out_path, "w") as f:
|
106 |
f.write(json.dumps(eval_entry))
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
##update queue file
|
110 |
+
queue_file = "./eval_queue.json"
|
111 |
#append the new entry to the queue file
|
112 |
queue_entries = []
|
113 |
if os.path.exists(queue_file):
|
114 |
+
print("Queue file exists")
|
115 |
with open(queue_file, "r") as f:
|
116 |
queue_entries = json.load(f)
|
117 |
queue_entries.append(eval_entry)
|
118 |
else:
|
119 |
+
print("Queue file exists")
|
120 |
queue_entries.append(eval_entry)
|
121 |
with open(queue_file, "w") as f:
|
122 |
json.dump(queue_entries, f, indent=4)
|
123 |
|
124 |
+
|
125 |
+
print("Uploading eval file")
|
126 |
+
API.upload_file(
|
127 |
+
path_or_fileobj=out_path,
|
128 |
+
path_in_repo=out_path,
|
129 |
+
repo_id=QUEUE_REPO,
|
130 |
+
repo_type="space",
|
131 |
+
commit_message=f"Add {model} to eval queue",
|
132 |
+
)
|
133 |
+
|
134 |
+
|
135 |
|
136 |
|
137 |
|