Update app.py
Browse files
app.py
CHANGED
@@ -307,21 +307,67 @@ def demo():
|
|
307 |
db_progress = gr.Textbox(label="Vector Database Initialization Status", value="None", interactive=False)
|
308 |
generate_db_btn = gr.Button("Generate Vector Database")
|
309 |
|
310 |
-
with gr.Tab("Step 3 - Initialize QA chain"):
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
|
326 |
with gr.Tab("Step 4: Chatbot"):
|
327 |
chatbot = gr.Chatbot(label="Chat with your PDF", height=300)
|
|
|
307 |
db_progress = gr.Textbox(label="Vector Database Initialization Status", value="None", interactive=False)
|
308 |
generate_db_btn = gr.Button("Generate Vector Database")
|
309 |
|
310 |
+
# with gr.Tab("Step 3 - Initialize QA chain"):
|
311 |
+
# with gr.Row():
|
312 |
+
# llm_btn = gr.Radio(list_llm_simple, \
|
313 |
+
# label="LLM models", value = list_llm_simple[0], type="index", info="Choose your LLM model")
|
314 |
+
# with gr.Accordion("Advanced options - LLM model", open=False):
|
315 |
+
# with gr.Row():
|
316 |
+
# slider_temperature = gr.Slider(minimum = 0.01, maximum = 1.0, value=0.7, step=0.1, label="Temperature", info="Model temperature", interactive=True)
|
317 |
+
# with gr.Row():
|
318 |
+
# slider_maxtokens = gr.Slider(minimum = 224, maximum = 4096, value=1024, step=32, label="Max Tokens", info="Model max tokens", interactive=True)
|
319 |
+
# with gr.Row():
|
320 |
+
# slider_topk = gr.Slider(minimum = 1, maximum = 10, value=3, step=1, label="top-k samples", info="Model top-k samples", interactive=True)
|
321 |
+
# with gr.Row():
|
322 |
+
# llm_progress = gr.Textbox(value="None",label="QA chain initialization")
|
323 |
+
# with gr.Row():
|
324 |
+
# qachain_btn = gr.Button("Initialize Question Answering chain")
|
325 |
+
|
326 |
+
with gr.Tab("Step 3 - Initialize QA Chain"):
|
327 |
+
with gr.Row():
|
328 |
+
llm_btn = gr.Radio(
|
329 |
+
["Mistral 7B"], # Only Mistral 7B is listed
|
330 |
+
label="LLM Model",
|
331 |
+
value="Mistral 7B", # Default selection is Mistral 7B
|
332 |
+
type="index",
|
333 |
+
info="Using Mistral 7B LLM model"
|
334 |
+
)
|
335 |
+
with gr.Accordion("Advanced Options - LLM Model", open=False):
|
336 |
+
with gr.Row():
|
337 |
+
slider_temperature = gr.Slider(
|
338 |
+
minimum=0.01,
|
339 |
+
maximum=1.0,
|
340 |
+
value=0.7,
|
341 |
+
step=0.1,
|
342 |
+
label="Temperature",
|
343 |
+
info="Adjusts the creativity of the model",
|
344 |
+
interactive=True
|
345 |
+
)
|
346 |
+
with gr.Row():
|
347 |
+
slider_maxtokens = gr.Slider(
|
348 |
+
minimum=224,
|
349 |
+
maximum=4096,
|
350 |
+
value=1024,
|
351 |
+
step=32,
|
352 |
+
label="Max Tokens",
|
353 |
+
info="Sets the maximum token limit",
|
354 |
+
interactive=True
|
355 |
+
)
|
356 |
+
with gr.Row():
|
357 |
+
slider_topk = gr.Slider(
|
358 |
+
minimum=1,
|
359 |
+
maximum=10,
|
360 |
+
value=3,
|
361 |
+
step=1,
|
362 |
+
label="Top-K Samples",
|
363 |
+
info="Selects the number of top-k samples",
|
364 |
+
interactive=True
|
365 |
+
)
|
366 |
+
with gr.Row():
|
367 |
+
llm_progress = gr.Textbox(value="None", label="QA Chain Initialization Status", interactive=False)
|
368 |
+
with gr.Row():
|
369 |
+
qachain_btn = gr.Button("Initialize Question Answering Chain")
|
370 |
+
|
371 |
|
372 |
with gr.Tab("Step 4: Chatbot"):
|
373 |
chatbot = gr.Chatbot(label="Chat with your PDF", height=300)
|