manu commited on
Commit
4be1e51
1 Parent(s): 4e6cb11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)