Spaces:
Sleeping
Sleeping
HUANG-Stephanie
commited on
Commit
•
8450327
1
Parent(s):
b6b56a0
Update app.py
Browse files
app.py
CHANGED
@@ -60,8 +60,8 @@ model = ColPali.from_pretrained(
|
|
60 |
model.load_adapter(model_name)
|
61 |
processor = AutoProcessor.from_pretrained(model_name, token=token)
|
62 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
63 |
-
|
64 |
-
|
65 |
mock_image = Image.new("RGB", (448, 448), (255, 255, 255))
|
66 |
|
67 |
with gr.Blocks() as demo:
|
|
|
60 |
model.load_adapter(model_name)
|
61 |
processor = AutoProcessor.from_pretrained(model_name, token=token)
|
62 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
63 |
+
if device != model.device:
|
64 |
+
model.to(device)
|
65 |
mock_image = Image.new("RGB", (448, 448), (255, 255, 255))
|
66 |
|
67 |
with gr.Blocks() as demo:
|