meg HF Staff commited on
Commit
85edd4e
·
verified ·
1 Parent(s): cb5ed2b

Filename changing.

Browse files
Files changed (1) hide show
  1. app.py +11 -11
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
- temp_out = temp_out_path + out_file
172
- print("Writing out temp request file to %s" % temp_out)
173
- with open(temp_out, "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,
179
- path_in_repo=dataset_out_path,
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.",