Rahatara commited on
Commit
a3580e4
·
verified ·
1 Parent(s): b8dc80e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -196,7 +196,7 @@ def get_example():
196
  ]
197
 
198
  with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
199
- gr.Markdown("# ColPali + Qwen2VL 2B: Efficient Document Retrieval with Vision Language Models 📚")
200
 
201
 
202
  with gr.Row():
@@ -205,16 +205,16 @@ with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
205
  file = gr.File(file_types=["pdf"], file_count="multiple", label="Upload PDFs")
206
 
207
 
208
- message = gr.Textbox("Files not yet uploaded", label="Status")
209
  convert_button = gr.Button("🔄 Index documents")
210
  embeds = gr.State(value=[])
211
  imgs = gr.State(value=[])
212
  img_chunk = gr.State(value=[])
213
 
214
  with gr.Column(scale=3):
215
- gr.Markdown("## 2️⃣ Search with ColPali")
216
  query = gr.Textbox(placeholder="Enter your query here", label="Query")
217
- k = gr.Slider(minimum=1, maximum=10, step=1, label="Number of results", value=1)
218
  search_button = gr.Button("🔍 Search", variant="primary")
219
 
220
  with gr.Row():
@@ -225,13 +225,13 @@ with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
225
 
226
  # Define the actions
227
 
228
- output_gallery = gr.Gallery(label="Retrieved Documents", height=600, show_label=True)
229
 
230
  convert_button.click(index, inputs=[file, embeds], outputs=[message, embeds, imgs])
231
  search_button.click(search, inputs=[query, embeds, imgs, k], outputs=[output_gallery])
232
 
233
- gr.Markdown("## 3️⃣ Get your answer with Qwen2-VL")
234
- answer_button = gr.Button("Answer", variant="primary")
235
  output = gr.Markdown(label="Output")
236
  answer_button.click(model_inference, inputs=[output_gallery, query], outputs=output)
237
 
 
196
  ]
197
 
198
  with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
199
+ gr.Markdown("🤓 Mulimoal RAGBOT: Ask Me About the Images 🌅 in Your PDF📚")
200
 
201
 
202
  with gr.Row():
 
205
  file = gr.File(file_types=["pdf"], file_count="multiple", label="Upload PDFs")
206
 
207
 
208
+ message = gr.Textbox("Files not yet chunked", label="Status")
209
  convert_button = gr.Button("🔄 Index documents")
210
  embeds = gr.State(value=[])
211
  imgs = gr.State(value=[])
212
  img_chunk = gr.State(value=[])
213
 
214
  with gr.Column(scale=3):
215
+ gr.Markdown("## 2️⃣ Search the Image")
216
  query = gr.Textbox(placeholder="Enter your query here", label="Query")
217
+ k = gr.Slider(minimum=1, maximum=10, step=1, label="batch", value=1)
218
  search_button = gr.Button("🔍 Search", variant="primary")
219
 
220
  with gr.Row():
 
225
 
226
  # Define the actions
227
 
228
+ output_gallery = gr.Gallery(label="Retrieved Images From Your Documents", height=600, show_label=True)
229
 
230
  convert_button.click(index, inputs=[file, embeds], outputs=[message, embeds, imgs])
231
  search_button.click(search, inputs=[query, embeds, imgs, k], outputs=[output_gallery])
232
 
233
+ gr.Markdown("## 3️⃣ Get your answer")
234
+ answer_button = gr.Button("💁‍♀️Answer", variant="primary")
235
  output = gr.Markdown(label="Output")
236
  answer_button.click(model_inference, inputs=[output_gallery, query], outputs=output)
237