Update app.py
Browse files
app.py
CHANGED
@@ -238,25 +238,18 @@ def demo():
|
|
238 |
vector_db = gr.State()
|
239 |
qa_chain = gr.State()
|
240 |
collection_name = gr.State()
|
241 |
-
|
242 |
-
|
243 |
-
"""<center><h2>PDF-based chatbot (powered by LangChain and open-source LLMs)</center></h2>
|
244 |
-
<h3>Ask any questions about your PDF documents, along with follow-ups</h3>
|
245 |
-
<b>Note:</b> This AI assistant performs retrieval-augmented generation from your PDF documents. \
|
246 |
-
When generating answers, it takes past questions into account (via conversational memory), and includes document references for clarity purposes.</i>
|
247 |
-
<br><b>Warning:</b> This space uses the free CPU Basic hardware from Hugging Face. Some steps and LLM models used below (free inference endpoints) can take some time to generate an output.<br>
|
248 |
-
""")
|
249 |
-
|
250 |
with gr.Row():
|
251 |
document = gr.Files(height=100, file_count="multiple", file_types=["pdf"], interactive=True, label="Upload your PDF documents (single or multiple)")
|
252 |
# upload_btn = gr.UploadButton("Loading document...", height=100, file_count="multiple", file_types=["pdf"], scale=1)
|
253 |
with gr.Row():
|
254 |
-
db_btn = gr.Radio(["ChromaDB"], label="Vector database type", value = "ChromaDB", type="index", info="Choose your vector database")
|
255 |
-
with gr.Accordion("Advanced options - Document text splitter", open=False):
|
256 |
with gr.Row():
|
257 |
-
slider_chunk_size = gr.Slider(
|
258 |
with gr.Row():
|
259 |
-
slider_chunk_overlap = gr.Slider(
|
260 |
with gr.Row():
|
261 |
db_progress = gr.Textbox(label="Vector database initialization", value="None")
|
262 |
with gr.Row():
|
|
|
238 |
vector_db = gr.State()
|
239 |
qa_chain = gr.State()
|
240 |
collection_name = gr.State()
|
241 |
+
slider_chunk_size = 2048
|
242 |
+
slider_chunk_overlap = 256
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
with gr.Row():
|
244 |
document = gr.Files(height=100, file_count="multiple", file_types=["pdf"], interactive=True, label="Upload your PDF documents (single or multiple)")
|
245 |
# upload_btn = gr.UploadButton("Loading document...", height=100, file_count="multiple", file_types=["pdf"], scale=1)
|
246 |
with gr.Row():
|
247 |
+
db_btn = gr.Radio(["ChromaDB"], label="Vector database type", value = "ChromaDB", type="index", info="Choose your vector database",visible=False)
|
248 |
+
with gr.Accordion("Advanced options - Document text splitter", open=False, visible=False):
|
249 |
with gr.Row():
|
250 |
+
slider_chunk_size = gr.Slider(value=2048, label="Chunk size", info="Chunk size", interactive=False, visible=False)
|
251 |
with gr.Row():
|
252 |
+
slider_chunk_overlap = gr.Slider(value=256, label="Chunk overlap", info="Chunk overlap", interactive=False, visible=False)
|
253 |
with gr.Row():
|
254 |
db_progress = gr.Textbox(label="Vector database initialization", value="None")
|
255 |
with gr.Row():
|