gizemsarsinlar commited on
Commit
f570019
·
verified ·
1 Parent(s): 593799b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -21
app.py CHANGED
@@ -183,28 +183,9 @@ 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
- summary_paragraph = (
187
- "The **NVIDIA AI Document Chatbot** is an application designed to facilitate user inquiries "
188
- "about specific documents by providing accurate, context-aware responses. It utilizes the "
189
- "**NVIDIAEmbeddings (NV-Embed-QA)** model to extract vector representations of text for efficient "
190
- "information retrieval and the **Mistral-8x7B Instruct** model to generate conversational answers "
191
- "based on the user's questions. The application processes academic papers using `ArxivLoader`, "
192
- "segments them into manageable text chunks, and stores them in a FAISS vector store for quick access. "
193
- "It also maintains a history of user interactions to enhance response accuracy over time. "
194
- "For more detailed information, please refer to the [README.md file](sandbox:/mnt/data/README.md)."
195
- )
196
 
197
- # Create the Gradio interface with the title and the summary
198
- with gr.Blocks() as demo:
199
- gr.HTML("<h1><center>Document AI Agent</center></h1>") # Centered title
200
- gr.Markdown(summary_paragraph) # Add the summary paragraph below the title
201
-
202
- chatbot = gr.Chatbot(value=[[None, initial_msg]])
203
-
204
- # Chat interface
205
- chat_interface = gr.ChatInterface(chat_gen, chatbot=chatbot).queue()
206
-
207
- # Launch the demo
208
  try:
209
  demo.launch(debug=True, share=False, show_api=False)
210
  demo.close()
 
183
  # for response in chat_gen(test_question, return_buffer=False):
184
  # print(response, end='')
185
 
186
+ chatbot = gr.Chatbot(value = [[None, initial_msg]])
187
+ demo = gr.ChatInterface(chat_gen, chatbot=chatbot).queue()
 
 
 
 
 
 
 
 
188
 
 
 
 
 
 
 
 
 
 
 
 
189
  try:
190
  demo.launch(debug=True, share=False, show_api=False)
191
  demo.close()