Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -86,27 +86,29 @@ def create_chat_interface():
|
|
86 |
gr.Markdown("## Math Hint Chat")
|
87 |
gr.Markdown(
|
88 |
"This chatbot provides hints and step-by-step guidance for solving math problems. "
|
|
|
89 |
)
|
90 |
|
91 |
chatbot = gr.Chatbot(label="Math Tutor Chat")
|
92 |
user_input = gr.Textbox(
|
93 |
-
placeholder="Ask your math question here (e.g.,
|
94 |
label="Your Query"
|
95 |
)
|
96 |
send_button = gr.Button("Send")
|
97 |
|
98 |
-
# Hidden state
|
99 |
chat_history = gr.State([])
|
100 |
|
101 |
# Button interaction for chat
|
102 |
send_button.click(
|
103 |
fn=generate_response,
|
104 |
inputs=[chat_history, user_input],
|
105 |
-
outputs=[chatbot
|
106 |
)
|
107 |
|
108 |
return chat_app
|
109 |
|
110 |
|
|
|
111 |
app = create_chat_interface()
|
112 |
app.launch(debug=True)
|
|
|
86 |
gr.Markdown("## Math Hint Chat")
|
87 |
gr.Markdown(
|
88 |
"This chatbot provides hints and step-by-step guidance for solving math problems. "
|
89 |
+
"It will not reveal the final answer."
|
90 |
)
|
91 |
|
92 |
chatbot = gr.Chatbot(label="Math Tutor Chat")
|
93 |
user_input = gr.Textbox(
|
94 |
+
placeholder="Ask your math question here (e.g., Solve for x: 4x + 5 = 6x + 7)",
|
95 |
label="Your Query"
|
96 |
)
|
97 |
send_button = gr.Button("Send")
|
98 |
|
99 |
+
# Hidden state for managing chat history
|
100 |
chat_history = gr.State([])
|
101 |
|
102 |
# Button interaction for chat
|
103 |
send_button.click(
|
104 |
fn=generate_response,
|
105 |
inputs=[chat_history, user_input],
|
106 |
+
outputs=[chatbot]
|
107 |
)
|
108 |
|
109 |
return chat_app
|
110 |
|
111 |
|
112 |
+
|
113 |
app = create_chat_interface()
|
114 |
app.launch(debug=True)
|