Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,7 +167,8 @@ def chatbot_interface(message, history, use_web_search):
|
|
| 167 |
main_content, sources = get_response_from_pdf(message)
|
| 168 |
|
| 169 |
formatted_response = f"{main_content}\n\nSources:\n{sources}"
|
| 170 |
-
|
|
|
|
| 171 |
|
| 172 |
# Gradio interface
|
| 173 |
with gr.Blocks() as demo:
|
|
@@ -181,13 +182,11 @@ with gr.Blocks() as demo:
|
|
| 181 |
update_output = gr.Textbox(label="Update Status")
|
| 182 |
update_button.click(update_vectors, inputs=[file_input, parser_dropdown], outputs=update_output)
|
| 183 |
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
submit = gr.Button("Submit")
|
| 190 |
-
|
| 191 |
gr.Examples(
|
| 192 |
examples=[
|
| 193 |
["What are the latest developments in AI?"],
|
|
|
|
| 167 |
main_content, sources = get_response_from_pdf(message)
|
| 168 |
|
| 169 |
formatted_response = f"{main_content}\n\nSources:\n{sources}"
|
| 170 |
+
history.append((message, formatted_response))
|
| 171 |
+
return history
|
| 172 |
|
| 173 |
# Gradio interface
|
| 174 |
with gr.Blocks() as demo:
|
|
|
|
| 182 |
update_output = gr.Textbox(label="Update Status")
|
| 183 |
update_button.click(update_vectors, inputs=[file_input, parser_dropdown], outputs=update_output)
|
| 184 |
|
| 185 |
+
chatbot = gr.Chatbot(label="Conversation")
|
| 186 |
+
msg = gr.Textbox(label="Ask a question")
|
| 187 |
+
use_web_search = gr.Checkbox(label="Use Web Search", value=False)
|
| 188 |
+
submit = gr.Button("Submit")
|
| 189 |
+
|
|
|
|
|
|
|
| 190 |
gr.Examples(
|
| 191 |
examples=[
|
| 192 |
["What are the latest developments in AI?"],
|