Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ processor = ColQwen2Processor.from_pretrained("manu/colqwen2-v1.0-alpha")
|
|
31 |
|
32 |
@spaces.GPU
|
33 |
def search(query: str, ds, images, k):
|
34 |
-
|
35 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
36 |
if device != model.device:
|
37 |
model.to(device)
|
|
|
31 |
|
32 |
@spaces.GPU
|
33 |
def search(query: str, ds, images, k):
|
34 |
+
k = min(k, len(ds))
|
35 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
36 |
if device != model.device:
|
37 |
model.to(device)
|