1Suro1 commited on
Commit
f317a71
1 Parent(s): 61a2dd5
Files changed (1) hide show
  1. app.py +33 -1
app.py CHANGED
@@ -37,7 +37,7 @@ def submit_file(v, file_path, mn, profile: gr.OAuthProfile | None):
37
  buf.write(json.dumps(new_file).encode('utf-8'))
38
  API.upload_file(
39
  path_or_fileobj=buf,
40
- path_in_repo="model_data/external/" + su + mn + ".json",
41
  repo_id="Vikhrmodels/s-openbench-eval",
42
  repo_type="dataset",
43
  )
@@ -167,6 +167,38 @@ def build_demo():
167
  [out]
168
  )
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  return demo
172
 
 
37
  buf.write(json.dumps(new_file).encode('utf-8'))
38
  API.upload_file(
39
  path_or_fileobj=buf,
40
+ path_in_repo="model_data/external/" + profile.username + mn + ".json",
41
  repo_id="Vikhrmodels/s-openbench-eval",
42
  repo_type="dataset",
43
  )
 
167
  [out]
168
  )
169
 
170
+ with gr.TabItem("Analytics", elem_id="llm-benchmark-tab-table", id=3):
171
+ with gr.Column():
172
+
173
+ model_name_textbox = gr.Textbox(label="Model name")
174
+ # submitter_username = gr.Textbox(label="Username")
175
+
176
+ # def toggle_upload_button(model_name, username):
177
+ # return bool(model_name) and bool(username)
178
+ file_output = gr.File(label="Drag and drop JSON file judgment here", type="filepath")
179
+ # upload_button = gr.Button("Click to Upload & Submit Answers", elem_id="upload_button",variant='primary')
180
+ uploaded_file = gr.State()
181
+ file_path = gr.State()
182
+ with gr.Row():
183
+ with gr.Column():
184
+ out = gr.Textbox("Статус отправки")
185
+ with gr.Column():
186
+ login_button = gr.LoginButton(elem_id="oauth-button")
187
+
188
+ submit_button = gr.Button("Submit File", elem_id="submit_button", variant='primary')
189
+
190
+ file_output.upload(
191
+ handle_file_upload,
192
+ file_output,
193
+ [uploaded_file, file_path]
194
+ )
195
+
196
+ submit_button.click(
197
+ submit_file,
198
+ [uploaded_file, file_path, model_name_textbox],
199
+ [out]
200
+ )
201
+
202
 
203
  return demo
204