Toumaima commited on
Commit
372022a
·
verified ·
1 Parent(s): 0bd9d4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -175,7 +175,7 @@ class BasicAgent:
175
  def run_and_submit_all(profile, test_mode):
176
  space_id = os.getenv("SPACE_ID")
177
  if profile:
178
- username = profile.username
179
  print(f"User logged in: {username}")
180
  else:
181
  return "Please Login to Hugging Face with the button.", None
@@ -249,16 +249,19 @@ with gr.Blocks() as demo:
249
  3. Click the button to run evaluation and submit your answers.
250
  """
251
  )
252
- gr.LoginButton()
253
 
254
- # Simulate OAuth profile for testing
255
  test_checkbox = gr.Checkbox(label="Enable Test Mode (Skip Submission)", value=False)
256
  run_button = gr.Button("Run Evaluation")
257
  status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
258
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
 
 
 
 
259
  run_button.click(
260
  fn=run_and_submit_all,
261
- inputs=[gr.OAuthProfile(), test_checkbox],
262
  outputs=[status_output, results_table]
263
  )
264
 
 
175
  def run_and_submit_all(profile, test_mode):
176
  space_id = os.getenv("SPACE_ID")
177
  if profile:
178
+ username = profile
179
  print(f"User logged in: {username}")
180
  else:
181
  return "Please Login to Hugging Face with the button.", None
 
249
  3. Click the button to run evaluation and submit your answers.
250
  """
251
  )
 
252
 
253
+ # Simulate OAuth profile with a textbox for user
254
  test_checkbox = gr.Checkbox(label="Enable Test Mode (Skip Submission)", value=False)
255
  run_button = gr.Button("Run Evaluation")
256
  status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
257
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
258
+
259
+ # Simulate OAuth Profile with a mock profile for now
260
+ mock_oauth_profile = gr.Textbox(label="Simulated OAuth Profile", value="mock_user", interactive=False)
261
+
262
  run_button.click(
263
  fn=run_and_submit_all,
264
+ inputs=[mock_oauth_profile, test_checkbox],
265
  outputs=[status_output, results_table]
266
  )
267