Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -232,7 +232,7 @@ with gr.Blocks() as app:
|
|
232 |
gr.Markdown("- Currently online demo support PDF document with less than 50 pages due to GPU time limit. Deploy on your own machine for longer PDFs and books.")
|
233 |
|
234 |
with gr.Row():
|
235 |
-
file_input = gr.File(type="binary", label="Upload PDF")
|
236 |
file_result = gr.Text(label="Knowledge Base ID (remember it, it is re-usable!)")
|
237 |
process_button = gr.Button("Process PDF (Don't click until PDF upload success)")
|
238 |
|
@@ -242,7 +242,7 @@ with gr.Blocks() as app:
|
|
242 |
kb_id_input = gr.Text(label="Your Knowledge Base ID (paste your Knowledge Base ID here, it is re-usable:)")
|
243 |
query_input = gr.Text(label="Your Queston")
|
244 |
topk_input = inputs=gr.Number(value=3, minimum=1, maximum=7, step=1, label="Number of pages to retrieve")
|
245 |
-
retrieve_button = gr.Button("Retrieve")
|
246 |
|
247 |
with gr.Row():
|
248 |
images_output = gr.Gallery(label="Retrieved Pages")
|
@@ -250,7 +250,7 @@ with gr.Blocks() as app:
|
|
250 |
retrieve_button.click(retrieve_gradio, inputs=[kb_id_input, query_input, topk_input], outputs=images_output)
|
251 |
|
252 |
with gr.Row():
|
253 |
-
button = gr.Button("Answer Question with Retrieved Pages")
|
254 |
|
255 |
gen_model_response = gr.Textbox(label="MiniCPM-V-2.6's Answer")
|
256 |
|
|
|
232 |
gr.Markdown("- Currently online demo support PDF document with less than 50 pages due to GPU time limit. Deploy on your own machine for longer PDFs and books.")
|
233 |
|
234 |
with gr.Row():
|
235 |
+
file_input = gr.File(type="binary", label="Step 1: Upload PDF")
|
236 |
file_result = gr.Text(label="Knowledge Base ID (remember it, it is re-usable!)")
|
237 |
process_button = gr.Button("Process PDF (Don't click until PDF upload success)")
|
238 |
|
|
|
242 |
kb_id_input = gr.Text(label="Your Knowledge Base ID (paste your Knowledge Base ID here, it is re-usable:)")
|
243 |
query_input = gr.Text(label="Your Queston")
|
244 |
topk_input = inputs=gr.Number(value=3, minimum=1, maximum=7, step=1, label="Number of pages to retrieve")
|
245 |
+
retrieve_button = gr.Button("Step2: Retrieve Pages")
|
246 |
|
247 |
with gr.Row():
|
248 |
images_output = gr.Gallery(label="Retrieved Pages")
|
|
|
250 |
retrieve_button.click(retrieve_gradio, inputs=[kb_id_input, query_input, topk_input], outputs=images_output)
|
251 |
|
252 |
with gr.Row():
|
253 |
+
button = gr.Button("Step 3: Answer Question with Retrieved Pages")
|
254 |
|
255 |
gen_model_response = gr.Textbox(label="MiniCPM-V-2.6's Answer")
|
256 |
|