Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,12 +14,6 @@ from tqdm import tqdm
|
|
14 |
from colpali_engine.models import ColQwen2, ColQwen2Processor
|
15 |
|
16 |
|
17 |
-
def install_fa2():
|
18 |
-
print("Install FA2")
|
19 |
-
os.system("pip install flash-attn --no-build-isolation")
|
20 |
-
|
21 |
-
# install_fa2()
|
22 |
-
|
23 |
|
24 |
model = ColQwen2.from_pretrained(
|
25 |
"vidore/colqwen2-v1.0",
|
@@ -139,7 +133,7 @@ def index_gpu(images, ds):
|
|
139 |
# run inference - docs
|
140 |
dataloader = DataLoader(
|
141 |
images,
|
142 |
-
batch_size=
|
143 |
shuffle=False,
|
144 |
collate_fn=lambda x: processor.process_images(x).to(model.device),
|
145 |
)
|
@@ -190,4 +184,4 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
190 |
search_button.click(search, inputs=[query, embeds, imgs, k, api_key], outputs=[output_gallery, output_text])
|
191 |
|
192 |
if __name__ == "__main__":
|
193 |
-
demo.queue(max_size=
|
|
|
14 |
from colpali_engine.models import ColQwen2, ColQwen2Processor
|
15 |
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
model = ColQwen2.from_pretrained(
|
19 |
"vidore/colqwen2-v1.0",
|
|
|
133 |
# run inference - docs
|
134 |
dataloader = DataLoader(
|
135 |
images,
|
136 |
+
batch_size=16,
|
137 |
shuffle=False,
|
138 |
collate_fn=lambda x: processor.process_images(x).to(model.device),
|
139 |
)
|
|
|
184 |
search_button.click(search, inputs=[query, embeds, imgs, k, api_key], outputs=[output_gallery, output_text])
|
185 |
|
186 |
if __name__ == "__main__":
|
187 |
+
demo.queue(max_size=5).launch(debug=True)
|