alozowski commited on
Commit
19d46ae
1 Parent(s): f02f25c

Fix vote system bug

Browse files
Files changed (1) hide show
  1. src/submission/submit.py +12 -13
src/submission/submit.py CHANGED
@@ -68,13 +68,12 @@ def add_new_eval(
68
  use_chat_template: bool,
69
  profile: gr.OAuthProfile | None
70
  ):
71
- # # Login required
72
- # if profile is None:
73
- # return styled_error("Hub Login Required")
74
 
75
- # # Name of the actual user who sent the request
76
- # username = profile.username
77
- username = "test"
78
 
79
  global REQUESTED_MODELS
80
  global USERS_TO_SUBMISSION_DATES
@@ -188,13 +187,13 @@ def add_new_eval(
188
 
189
  print("Uploading eval file")
190
  print(eval_entry)
191
- # API.upload_file(
192
- # path_or_fileobj=out_path,
193
- # path_in_repo=out_path.split("eval-queue/")[1],
194
- # repo_id=QUEUE_REPO,
195
- # repo_type="dataset",
196
- # commit_message=f"Add {model} to eval queue",
197
- # )
198
 
199
  # Remove the local file
200
  os.remove(out_path)
 
68
  use_chat_template: bool,
69
  profile: gr.OAuthProfile | None
70
  ):
71
+ # Login required
72
+ if profile is None:
73
+ return styled_error("Hub Login Required")
74
 
75
+ # Name of the actual user who sent the request
76
+ username = profile.username
 
77
 
78
  global REQUESTED_MODELS
79
  global USERS_TO_SUBMISSION_DATES
 
187
 
188
  print("Uploading eval file")
189
  print(eval_entry)
190
+ API.upload_file(
191
+ path_or_fileobj=out_path,
192
+ path_in_repo=out_path.split("eval-queue/")[1],
193
+ repo_id=QUEUE_REPO,
194
+ repo_type="dataset",
195
+ commit_message=f"Add {model} to eval queue",
196
+ )
197
 
198
  # Remove the local file
199
  os.remove(out_path)