Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -64,6 +64,19 @@ def parse_output_llm_with_sources(output):
|
|
64 |
parts.append(part)
|
65 |
content_parts = "".join(parts)
|
66 |
return content_parts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
#process_pdf()
|
68 |
|
69 |
|
@@ -265,6 +278,8 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
|
|
265 |
- By using this chatbot, you agree to these terms and acknowledge that you are solely responsible for any reliance on or actions taken based on its responses.
|
266 |
- **This is just a prototype and being tested and worked upon, so its not perfect and may sometimes give irrelevant answers**. If you are not satisfied with the answer, please ask a more specific question or report your feedback to help us improve the system.
|
267 |
""")
|
|
|
|
|
268 |
demo.queue()
|
269 |
|
270 |
demo.launch()
|
|
|
64 |
parts.append(part)
|
65 |
content_parts = "".join(parts)
|
66 |
return content_parts
|
67 |
+
|
68 |
+
async def chat(query,history,sources,reports):
|
69 |
+
"""taking a query and a message history, use a pipeline (reformulation, retriever, answering) to yield a tuple of:
|
70 |
+
(messages in gradio format, messages in langchain format, source documents)"""
|
71 |
+
|
72 |
+
print(f">> NEW QUESTION : {query}")
|
73 |
+
print(f"history:{history}")
|
74 |
+
#print(f"audience:{audience}")
|
75 |
+
print(f"sources:{sources}")
|
76 |
+
print(f"reports:{reports}")
|
77 |
+
docs_html = ""
|
78 |
+
output_query = ""
|
79 |
+
output_language = "English"
|
80 |
#process_pdf()
|
81 |
|
82 |
|
|
|
278 |
- By using this chatbot, you agree to these terms and acknowledge that you are solely responsible for any reliance on or actions taken based on its responses.
|
279 |
- **This is just a prototype and being tested and worked upon, so its not perfect and may sometimes give irrelevant answers**. If you are not satisfied with the answer, please ask a more specific question or report your feedback to help us improve the system.
|
280 |
""")
|
281 |
+
|
282 |
+
(textbox.then(chat))
|
283 |
demo.queue()
|
284 |
|
285 |
demo.launch()
|