Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -83,25 +83,18 @@ def handle_query(query):
|
|
83 |
print("Processing PDF ingestion from directory:", PDF_DIRECTORY)
|
84 |
data_ingestion_from_directory()
|
85 |
|
86 |
-
# Define the input and output components for the Gradio interface
|
87 |
-
input_component = gr.Textbox(
|
88 |
-
show_label=False,
|
89 |
-
placeholder="Ask me anything about the document..."
|
90 |
-
)
|
91 |
-
|
92 |
-
output_component = gr.Textbox()
|
93 |
-
|
94 |
# Function to handle queries
|
95 |
def chatbot_handler(query):
|
96 |
response = handle_query(query)
|
97 |
return response
|
98 |
|
99 |
-
# Create the Gradio interface with
|
100 |
interface = gr.Interface(
|
101 |
fn=chatbot_handler,
|
102 |
-
inputs=
|
103 |
-
outputs=
|
104 |
-
|
|
|
105 |
description="Ask me anything about the uploaded document. I'll provide answers based on our conversation history.",
|
106 |
theme="compact", # Change the theme if desired
|
107 |
examples=[
|
|
|
83 |
print("Processing PDF ingestion from directory:", PDF_DIRECTORY)
|
84 |
data_ingestion_from_directory()
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
# Function to handle queries
|
87 |
def chatbot_handler(query):
|
88 |
response = handle_query(query)
|
89 |
return response
|
90 |
|
91 |
+
# Create the Gradio interface with streaming capabilities
|
92 |
interface = gr.Interface(
|
93 |
fn=chatbot_handler,
|
94 |
+
inputs=gr.Textbox(label="Input", placeholder="Type your message here..."),
|
95 |
+
outputs=gr.Textbox(label="Output", placeholder="Bot's response will appear here..."),
|
96 |
+
live=True, # Enable streaming
|
97 |
+
title="RedfernsTech Streaming Q&A Chatbot",
|
98 |
description="Ask me anything about the uploaded document. I'll provide answers based on our conversation history.",
|
99 |
theme="compact", # Change the theme if desired
|
100 |
examples=[
|