Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,17 +90,18 @@ input_component = gr.Textbox(
|
|
| 90 |
lines=2
|
| 91 |
)
|
| 92 |
|
| 93 |
-
output_component = gr.
|
| 94 |
label="Bot:",
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
lines=2
|
| 98 |
)
|
| 99 |
|
| 100 |
# Function to handle queries
|
| 101 |
def chatbot_handler(query):
|
| 102 |
-
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
# Create the Gradio interface with chat-like settings
|
| 106 |
interface = gr.Interface(
|
|
|
|
| 90 |
lines=2
|
| 91 |
)
|
| 92 |
|
| 93 |
+
output_component = gr.Output(
|
| 94 |
label="Bot:",
|
| 95 |
+
type="text",
|
| 96 |
+
initial="Bot's response will appear here...",
|
|
|
|
| 97 |
)
|
| 98 |
|
| 99 |
# Function to handle queries
|
| 100 |
def chatbot_handler(query):
|
| 101 |
+
with output_component:
|
| 102 |
+
response = handle_query(query)
|
| 103 |
+
print(f"User: {query}\nBot: {response}\n")
|
| 104 |
+
return response
|
| 105 |
|
| 106 |
# Create the Gradio interface with chat-like settings
|
| 107 |
interface = gr.Interface(
|