Spaces:
Sleeping
Sleeping
gizemsarsinlar
commited on
Commit
•
caeaddf
1
Parent(s):
56e11c5
Update app.py
Browse files
app.py
CHANGED
@@ -183,8 +183,26 @@ def chat_gen(message, history=[], return_buffer=True):
|
|
183 |
# for response in chat_gen(test_question, return_buffer=False):
|
184 |
# print(response, end='')
|
185 |
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
try:
|
190 |
demo.launch(debug=True, share=False, show_api=False)
|
|
|
183 |
# for response in chat_gen(test_question, return_buffer=False):
|
184 |
# print(response, end='')
|
185 |
|
186 |
+
# Summary paragraph to be displayed at the top
|
187 |
+
summary_paragraph = (
|
188 |
+
"The **NVIDIA AI Document Chatbot** is an application designed to facilitate user inquiries "
|
189 |
+
"about specific documents by providing accurate, context-aware responses. It utilizes the "
|
190 |
+
"**NVIDIAEmbeddings (NV-Embed-QA)** model to extract vector representations of text for efficient "
|
191 |
+
"information retrieval and the **Mistral-8x7B Instruct** model to generate conversational answers "
|
192 |
+
"based on the user's questions. The application processes academic papers using `ArxivLoader`, "
|
193 |
+
"segments them into manageable text chunks, and stores them in a FAISS vector store for quick access. "
|
194 |
+
"It also maintains a history of user interactions to enhance response accuracy over time. "
|
195 |
+
"For more detailed information, please refer to the [README.md file](sandbox:/mnt/data/README.md)."
|
196 |
+
)
|
197 |
+
|
198 |
+
# Create the Gradio interface with the summary and the chatbot
|
199 |
+
with gr.Blocks() as demo:
|
200 |
+
gr.Markdown("### Welcome to the Document AI Chatbot!")
|
201 |
+
gr.Markdown(summary_paragraph) # Add the summary paragraph here
|
202 |
+
chatbot = gr.Chatbot(value=[[None, initial_msg]])
|
203 |
+
|
204 |
+
# Chat interface
|
205 |
+
chat_interface = gr.ChatInterface(chat_gen, chatbot=chatbot).queue()
|
206 |
|
207 |
try:
|
208 |
demo.launch(debug=True, share=False, show_api=False)
|