Spaces:
Running
Running
Writing out request files.
Browse files
app.py
CHANGED
@@ -167,10 +167,22 @@ def add_new_eval(
|
|
167 |
#if f"{model}_{revision}_{precision}" in REQUESTED_MODELS:
|
168 |
# return styled_warning("This model has been already submitted.")
|
169 |
|
170 |
-
|
171 |
-
|
|
|
172 |
f.write(json.dumps(request_dict))
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
print("Starting compute space at %s " % COMPUTE_SPACE)
|
175 |
return start_compute_space()
|
176 |
|
|
|
167 |
#if f"{model}_{revision}_{precision}" in REQUESTED_MODELS:
|
168 |
# return styled_warning("This model has been already submitted.")
|
169 |
|
170 |
+
temp_out = "./temp/" + out_path
|
171 |
+
print("Writing out request file to %s" % temp_out)
|
172 |
+
with open(temp_out, "w+") as f:
|
173 |
f.write(json.dumps(request_dict))
|
174 |
|
175 |
+
API.upload_file(
|
176 |
+
path_or_fileobj=temp_out,
|
177 |
+
path_in_repo=out_path,
|
178 |
+
repo_id=REQUESTS_DATASET_PATH,
|
179 |
+
repo_type="dataset",
|
180 |
+
commit_message=f"Adding {model} to requests queue.",
|
181 |
+
)
|
182 |
+
|
183 |
+
# Remove the local file
|
184 |
+
os.remove(temp_out)
|
185 |
+
|
186 |
print("Starting compute space at %s " % COMPUTE_SPACE)
|
187 |
return start_compute_space()
|
188 |
|