Update app.py
Browse files
app.py
CHANGED
|
@@ -85,6 +85,8 @@ def index(files, ds):
|
|
| 85 |
return f"Uploaded and converted {len(images)} pages", ds, images
|
| 86 |
|
| 87 |
|
|
|
|
|
|
|
| 88 |
|
| 89 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 90 |
gr.Markdown("# ColPali: Efficient Document Retrieval with Vision Language Models ๐")
|
|
@@ -113,6 +115,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 113 |
query = gr.Textbox(placeholder="Enter your query here", label="Query")
|
| 114 |
k = gr.Slider(minimum=1, maximum=10, step=1, label="Number of results", value=5)
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
# Define the actions
|
| 117 |
search_button = gr.Button("๐ Search", variant="primary")
|
| 118 |
output_gallery = gr.Gallery(label="Retrieved Documents", height=600, show_label=True)
|
|
|
|
| 85 |
return f"Uploaded and converted {len(images)} pages", ds, images
|
| 86 |
|
| 87 |
|
| 88 |
+
def get_example():
|
| 89 |
+
return [[["climate_youth_magazine.pdf"], "How much tropical forest is cut annually ?"]]
|
| 90 |
|
| 91 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 92 |
gr.Markdown("# ColPali: Efficient Document Retrieval with Vision Language Models ๐")
|
|
|
|
| 115 |
query = gr.Textbox(placeholder="Enter your query here", label="Query")
|
| 116 |
k = gr.Slider(minimum=1, maximum=10, step=1, label="Number of results", value=5)
|
| 117 |
|
| 118 |
+
with gr.Row():
|
| 119 |
+
gr.Examples(
|
| 120 |
+
examples=get_example(),
|
| 121 |
+
inputs=[file, query],
|
| 122 |
+
|
| 123 |
# Define the actions
|
| 124 |
search_button = gr.Button("๐ Search", variant="primary")
|
| 125 |
output_gallery = gr.Gallery(label="Retrieved Documents", height=600, show_label=True)
|