Spaces:
Sleeping
Sleeping
text box will clear after search in third tab
Browse files
app.py
CHANGED
@@ -230,32 +230,18 @@ with gr.Blocks(css=css) as demo:
|
|
230 |
generic_chatbot_output = gr.Chatbot(height=600)
|
231 |
user_input_gc = gr.Textbox(placeholder="Type your question here...", label="Your Question", value="Loaves and fishes")
|
232 |
submit_button_gc = gr.Button("Submit")
|
233 |
-
|
234 |
-
with
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
<strong>Available sources:</strong>
|
246 |
-
<ul>
|
247 |
-
<li>Journey to Self-Realization</li>
|
248 |
-
<li>The Second Coming of Christ</li>
|
249 |
-
<li>Autobiography of a Yogi</li>
|
250 |
-
</ul>
|
251 |
-
</div>
|
252 |
-
""")
|
253 |
-
|
254 |
-
submit_button_gc.click(
|
255 |
-
fn=respond_genericchatbot,
|
256 |
-
inputs=[user_input_gc, generic_chatbot_output],
|
257 |
-
outputs=[generic_chatbot_output]
|
258 |
-
)
|
259 |
|
260 |
gr.Examples(
|
261 |
examples=[
|
|
|
230 |
generic_chatbot_output = gr.Chatbot(height=600)
|
231 |
user_input_gc = gr.Textbox(placeholder="Type your question here...", label="Your Question", value="Loaves and fishes")
|
232 |
submit_button_gc = gr.Button("Submit")
|
233 |
+
|
234 |
+
# ... (existing code for the column with markdown)
|
235 |
+
|
236 |
+
def respond_and_clear(query, history):
|
237 |
+
updated_history = respond_genericchatbot(query, history)
|
238 |
+
return updated_history, "" # Return updated history and empty string for input
|
239 |
+
|
240 |
+
submit_button_gc.click(
|
241 |
+
fn=respond_and_clear,
|
242 |
+
inputs=[user_input_gc, generic_chatbot_output],
|
243 |
+
outputs=[generic_chatbot_output, user_input_gc]
|
244 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
|
246 |
gr.Examples(
|
247 |
examples=[
|