p3nguknight commited on
Commit
3e53d56
Β·
1 Parent(s): 185aa79
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -173,9 +173,9 @@ css = """
173
  file = gr.File(file_types=["pdf"], file_count="multiple", label="pdfs")
174
  query = gr.Textbox(placeholder="Enter your query here", label="query")
175
 
176
- with gr.Blocks(title="ColPali + Pixtral", theme=gr.themes.Soft(), css=css) as demo:
177
  with gr.Column(elem_id="col-container"):
178
- gr.Markdown("# ColPali + Pixtral")
179
 
180
  with gr.Row():
181
  gr.Examples(
@@ -185,11 +185,10 @@ with gr.Blocks(title="ColPali + Pixtral", theme=gr.themes.Soft(), css=css) as de
185
 
186
  with gr.Row():
187
  with gr.Column(scale=2):
188
- gr.Markdown("## Upload PDFs")
189
-
190
  file.render()
 
191
  message = gr.Textbox("Files not yet uploaded", label="Status")
192
- convert_button = gr.Button("πŸ”„ Index documents")
193
  embeds = gr.State(value=[])
194
  imgs = gr.State(value=[])
195
  img_chunk = gr.State(value=[])
@@ -200,7 +199,7 @@ with gr.Blocks(title="ColPali + Pixtral", theme=gr.themes.Soft(), css=css) as de
200
  k = gr.Slider(
201
  minimum=1, maximum=4, step=1, label="Number of results", value=1
202
  )
203
- search_button = gr.Button("πŸ” Search", variant="primary")
204
 
205
  # Define the actions
206
 
@@ -216,7 +215,7 @@ with gr.Blocks(title="ColPali + Pixtral", theme=gr.themes.Soft(), css=css) as de
216
  )
217
 
218
  gr.Markdown("## Get your answer with Pixtral")
219
- answer_button = gr.Button("Answer", variant="primary")
220
  output = gr.Markdown(label="Output")
221
  answer_button.click(
222
  model_inference, inputs=[output_gallery, query], outputs=output
 
173
  file = gr.File(file_types=["pdf"], file_count="multiple", label="pdfs")
174
  query = gr.Textbox(placeholder="Enter your query here", label="query")
175
 
176
+ with gr.Blocks(title="Question Answering with ColPali & Pixtral", theme=gr.themes.Soft(), css=css) as demo:
177
  with gr.Column(elem_id="col-container"):
178
+ gr.Markdown("# Question Answering with ColPali & Pixtral")
179
 
180
  with gr.Row():
181
  gr.Examples(
 
185
 
186
  with gr.Row():
187
  with gr.Column(scale=2):
188
+ gr.Markdown("## Index PDFs")
 
189
  file.render()
190
+ convert_button = gr.Button("πŸ”„ Run", variant="primary")
191
  message = gr.Textbox("Files not yet uploaded", label="Status")
 
192
  embeds = gr.State(value=[])
193
  imgs = gr.State(value=[])
194
  img_chunk = gr.State(value=[])
 
199
  k = gr.Slider(
200
  minimum=1, maximum=4, step=1, label="Number of results", value=1
201
  )
202
+ search_button = gr.Button("πŸ” Run", variant="primary")
203
 
204
  # Define the actions
205
 
 
215
  )
216
 
217
  gr.Markdown("## Get your answer with Pixtral")
218
+ answer_button = gr.Button("Run", variant="primary")
219
  output = gr.Markdown(label="Output")
220
  answer_button.click(
221
  model_inference, inputs=[output_gallery, query], outputs=output