fix model weight and input are not in the same device
Browse files
app.py
CHANGED
@@ -47,6 +47,7 @@ def process_window(frames_window):
|
|
47 |
|
48 |
inputs = processor(images=frames_window, return_tensors="pt", padding=True)
|
49 |
if torch.cuda.is_available():
|
|
|
50 |
inputs = {k: v.cuda() for k, v in inputs.items()}
|
51 |
with torch.no_grad():
|
52 |
image_features = model.get_image_features(**inputs)
|
|
|
47 |
|
48 |
inputs = processor(images=frames_window, return_tensors="pt", padding=True)
|
49 |
if torch.cuda.is_available():
|
50 |
+
model = model.to(torch.device("cuda"))
|
51 |
inputs = {k: v.cuda() for k, v in inputs.items()}
|
52 |
with torch.no_grad():
|
53 |
image_features = model.get_image_features(**inputs)
|