Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -92,31 +92,25 @@ with gr.Blocks() as demo:
|
|
92 |
gr.Markdown("# SmolAgent Evaluation Runner")
|
93 |
gr.Markdown(
|
94 |
"""
|
95 |
-
**
|
96 |
-
1. Clone
|
97 |
-
2.
|
98 |
-
3.
|
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 /
|
112 |
-
table = gr.DataFrame(label="
|
113 |
-
qbox = gr.Textbox(label="
|
114 |
-
abox = gr.Textbox(label="
|
115 |
|
116 |
-
#
|
117 |
-
run_all.click(fn=run_and_submit_all, inputs=[
|
118 |
-
test.click(fn=test_random_question, inputs=[
|
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)
|
|