Ubik80 commited on
Commit
ee4d1e5
·
verified ·
1 Parent(s): 6a38a35

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -17
app.py CHANGED
@@ -92,31 +92,25 @@ with gr.Blocks() as demo:
92
  gr.Markdown("# SmolAgent Evaluation Runner")
93
  gr.Markdown(
94
  """
95
- **Istruzioni:**
96
- 1. Clone questo space e definisci la logica in agent.py.
97
- 2. Effettua il login con il tuo account Hugging Face.
98
- 3. Usa 'Run Evaluation & Submit All Answers' o 'Test Random Question'.
99
  """
100
  )
101
 
102
- # OAuth login and user state
103
  login = gr.LoginButton()
104
- user = gr.State()
105
- # On login, store profile in state
106
- login.click(fn=lambda profile: profile, inputs=[login], outputs=[user])
107
-
108
  run_all = gr.Button("Run Evaluation & Submit All Answers")
109
  test = gr.Button("Test Random Question")
110
 
111
- status = gr.Textbox(label="Status / Risultato", lines=5, interactive=False)
112
- table = gr.DataFrame(label="Risultati Completi", wrap=True)
113
- qbox = gr.Textbox(label="Domanda Casuale", lines=3, interactive=False)
114
- abox = gr.Textbox(label="Risposta Agente", lines=3, interactive=False)
115
 
116
- # Use stored user state as input
117
- run_all.click(fn=run_and_submit_all, inputs=[user], outputs=[status, table])
118
- test.click(fn=test_random_question, inputs=[user], outputs=[qbox, abox])
119
 
120
  if __name__ == "__main__":
121
  demo.launch(debug=True, share=False)
122
- demo.launch(debug=True, share=False)
 
92
  gr.Markdown("# SmolAgent Evaluation Runner")
93
  gr.Markdown(
94
  """
95
+ **Instructions:**
96
+ 1. Clone this space and define your agent logic in agent.py.
97
+ 2. Log in with your Hugging Face account using the login button.
98
+ 3. Use 'Run Evaluation & Submit All Answers' or 'Test Random Question'.
99
  """
100
  )
101
 
 
102
  login = gr.LoginButton()
 
 
 
 
103
  run_all = gr.Button("Run Evaluation & Submit All Answers")
104
  test = gr.Button("Test Random Question")
105
 
106
+ status = gr.Textbox(label="Status / Result", lines=5, interactive=False)
107
+ table = gr.DataFrame(label="Results Table", wrap=True)
108
+ qbox = gr.Textbox(label="Random Question", lines=3, interactive=False)
109
+ abox = gr.Textbox(label="Agent Answer", lines=3, interactive=False)
110
 
111
+ # Attach login component directly as input for profile
112
+ run_all.click(fn=run_and_submit_all, inputs=[login], outputs=[status, table])
113
+ test.click(fn=test_random_question, inputs=[login], outputs=[qbox, abox])
114
 
115
  if __name__ == "__main__":
116
  demo.launch(debug=True, share=False)