meg HF Staff commited on
Commit
818e1c4
·
verified ·
1 Parent(s): 60635ef

Writing requests.

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -101,10 +101,11 @@ def add_new_eval(
101
  model_name = repo_id.split("/")[1]
102
  precision = precision.split(" ")[0]
103
 
104
- out_dir = f"{REQUESTS_DATASET_PATH}/{model_owner}"
105
- print("Making Dataset directory to output results at %s" % out_dir)
106
- os.makedirs(out_dir, exist_ok=True)
107
- out_path = f"{REQUESTS_DATASET_PATH}/{model_owner}/{model_name}_eval_request_{precision}_{weight_type}.json"
 
108
 
109
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
110
 
@@ -167,11 +168,12 @@ 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
- 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,
 
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
  #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=out_path,