Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -223,10 +223,19 @@ with gr.Blocks() as demo:
|
|
| 223 |
csv_in = gr.File(label="Optional CSV (x,y for regression)", file_types=[".csv"])
|
| 224 |
degree_in = gr.Slider(1, 6, value=1, step=1, label="Polynomial degree (for regression)")
|
| 225 |
export_toggle = gr.Checkbox(label="Export PDF report?", value=False)
|
|
|
|
|
|
|
| 226 |
pdf_out = gr.File(label="Download PDF", type="filepath")
|
| 227 |
plot_out = gr.Image(label="Plot (if applicable)")
|
| 228 |
state = gr.State([])
|
| 229 |
|
|
|
|
| 230 |
msg.submit(bot, [msg, state, csv_in, degree_in, export_toggle], [chatbot_ui, state, plot_out, pdf_out])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
demo.launch()
|
|
|
|
| 223 |
csv_in = gr.File(label="Optional CSV (x,y for regression)", file_types=[".csv"])
|
| 224 |
degree_in = gr.Slider(1, 6, value=1, step=1, label="Polynomial degree (for regression)")
|
| 225 |
export_toggle = gr.Checkbox(label="Export PDF report?", value=False)
|
| 226 |
+
solve_btn = gr.Button("Solve ✅")
|
| 227 |
+
clear_btn = gr.Button("Clear Chat 🗑")
|
| 228 |
pdf_out = gr.File(label="Download PDF", type="filepath")
|
| 229 |
plot_out = gr.Image(label="Plot (if applicable)")
|
| 230 |
state = gr.State([])
|
| 231 |
|
| 232 |
+
# زر Enter و Solve
|
| 233 |
msg.submit(bot, [msg, state, csv_in, degree_in, export_toggle], [chatbot_ui, state, plot_out, pdf_out])
|
| 234 |
+
solve_btn.click(bot, [msg, state, csv_in, degree_in, export_toggle], [chatbot_ui, state, plot_out, pdf_out])
|
| 235 |
+
|
| 236 |
+
# زر مسح المحادثة
|
| 237 |
+
def clear_chat():
|
| 238 |
+
return [], [], None, None
|
| 239 |
+
clear_btn.click(clear_chat, outputs=[chatbot_ui, state, plot_out, pdf_out])
|
| 240 |
|
| 241 |
demo.launch()
|