Spaces:
Running
Running
Filename changing.
Browse files
app.py
CHANGED
@@ -100,12 +100,6 @@ def add_new_eval(
|
|
100 |
model_owner = repo_id.split("/")[0]
|
101 |
model_name = repo_id.split("/")[1]
|
102 |
precision = precision.split(" ")[0]
|
103 |
-
|
104 |
-
dataset_out_path = f"{REQUESTS_DATASET_PATH}/{model_owner}/"
|
105 |
-
temp_out_path = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/"
|
106 |
-
print("Making directory to output results at %s" % temp_out_path)
|
107 |
-
os.makedirs(temp_out_path, exist_ok=True)
|
108 |
-
out_file = f"{model_name}_eval_request_{precision}_{weight_type}.json"
|
109 |
|
110 |
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
111 |
|
@@ -168,15 +162,21 @@ def add_new_eval(
|
|
168 |
#if f"{model}_{revision}_{precision}" in REQUESTED_MODELS:
|
169 |
# return styled_warning("This model has been already submitted.")
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
f.write(json.dumps(request_dict))
|
175 |
|
176 |
print("Uploading request to Dataset repo at %s" % REQUESTS_DATASET_PATH)
|
177 |
API.upload_file(
|
178 |
-
path_or_fileobj=
|
179 |
-
path_in_repo=
|
180 |
repo_id=REQUESTS_DATASET_PATH,
|
181 |
repo_type="dataset",
|
182 |
commit_message=f"Adding {model_name} to requests queue.",
|
|
|
100 |
model_owner = repo_id.split("/")[0]
|
101 |
model_name = repo_id.split("/")[1]
|
102 |
precision = precision.split(" ")[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
105 |
|
|
|
162 |
#if f"{model}_{revision}_{precision}" in REQUESTED_MODELS:
|
163 |
# return styled_warning("This model has been already submitted.")
|
164 |
|
165 |
+
|
166 |
+
out_file = f"{model_name}_eval_request_{precision}_{weight_type}.json"
|
167 |
+
temp_out_path = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/"
|
168 |
+
temp_out_file = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/{out_file}"
|
169 |
+
print("Making directory to output results at %s" % temp_out_path)
|
170 |
+
os.makedirs(temp_out_path, exist_ok=True)
|
171 |
+
|
172 |
+
print("Writing out temp request file to %s" % temp_out_file)
|
173 |
+
with open(temp_out_file, "w+") as f:
|
174 |
f.write(json.dumps(request_dict))
|
175 |
|
176 |
print("Uploading request to Dataset repo at %s" % REQUESTS_DATASET_PATH)
|
177 |
API.upload_file(
|
178 |
+
path_or_fileobj=temp_out_file,
|
179 |
+
path_in_repo=f"{REQUESTS_DATASET_PATH}/{model_owner}/{out_file}",
|
180 |
repo_id=REQUESTS_DATASET_PATH,
|
181 |
repo_type="dataset",
|
182 |
commit_message=f"Adding {model_name} to requests queue.",
|