Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ def search(query: str, ds, images) -> str:
|
|
64 |
# return f"Query: {query}, most relevant page: 1, {len(ds)}", images[1]
|
65 |
|
66 |
|
67 |
-
def index(file):
|
68 |
"""Example script to run inference with ColPali"""
|
69 |
images = []
|
70 |
for f in file:
|
@@ -103,13 +103,13 @@ with gr.Blocks() as demo:
|
|
103 |
gr.Markdown("## 2οΈβ£ Convert the PDFs and upload")
|
104 |
convert_button = gr.Button("π Convert and upload")
|
105 |
message = gr.Textbox("Files not yet uploaded")
|
106 |
-
embeds = gr.State()
|
107 |
imgs = gr.State()
|
108 |
|
109 |
# Define the actions
|
110 |
convert_button.click(
|
111 |
index,
|
112 |
-
inputs=[file],
|
113 |
outputs=[message, embeds, imgs]
|
114 |
)
|
115 |
|
|
|
64 |
# return f"Query: {query}, most relevant page: 1, {len(ds)}", images[1]
|
65 |
|
66 |
|
67 |
+
def index(file, ds):
|
68 |
"""Example script to run inference with ColPali"""
|
69 |
images = []
|
70 |
for f in file:
|
|
|
103 |
gr.Markdown("## 2οΈβ£ Convert the PDFs and upload")
|
104 |
convert_button = gr.Button("π Convert and upload")
|
105 |
message = gr.Textbox("Files not yet uploaded")
|
106 |
+
embeds = gr.State(value=[])
|
107 |
imgs = gr.State()
|
108 |
|
109 |
# Define the actions
|
110 |
convert_button.click(
|
111 |
index,
|
112 |
+
inputs=[file, embeds],
|
113 |
outputs=[message, embeds, imgs]
|
114 |
)
|
115 |
|