shahed125238 commited on
Commit
03b9f32
·
verified ·
1 Parent(s): cf41ede

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -163,12 +163,13 @@ with gr.Blocks() as demo:
163
  response_box = gr.Markdown(label="Chatbot Response")
164
 
165
  # Define button actions
166
- predict_button.click(fn=lambda air, proc, spd, tq, wear: predict_status(air, proc, spd, tq, wear),
167
  inputs=[air_temp, proc_temp, speed, torque, tool_wear],
168
- outputs=output_status)
169
 
170
- submit_btn.click(fn=lambda reason: handle_query(reason),
171
- inputs=output_status,
 
172
  outputs=response_box)
173
 
174
  # Display the PDF content
 
163
  response_box = gr.Markdown(label="Chatbot Response")
164
 
165
  # Define button actions
166
+ predict_button.click(fn=predict_status,
167
  inputs=[air_temp, proc_temp, speed, torque, tool_wear],
168
+ outputs=[output_status, gr.Variable("reasons")])
169
 
170
+ # Correcting the submit_btn action to extract reasons properly
171
+ submit_btn.click(fn=lambda reasons: handle_query(reasons),
172
+ inputs=gr.Variable("reasons"),
173
  outputs=response_box)
174
 
175
  # Display the PDF content