Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
7 |
|
8 |
model = torch.hub.load('mair-lab/mapl', 'mapl')
|
9 |
model.eval()
|
10 |
-
model.to(device, torch.
|
11 |
|
12 |
|
13 |
def predict(image: Image.Image, question: str) -> str:
|
14 |
-
pixel_values = model.image_transform(image).unsqueeze(0).to(device, torch.
|
15 |
|
16 |
input_ids = None
|
17 |
if question:
|
|
|
7 |
|
8 |
model = torch.hub.load('mair-lab/mapl', 'mapl')
|
9 |
model.eval()
|
10 |
+
model.to(device, torch.float16)
|
11 |
|
12 |
|
13 |
def predict(image: Image.Image, question: str) -> str:
|
14 |
+
pixel_values = model.image_transform(image).unsqueeze(0).to(device, torch.float16)
|
15 |
|
16 |
input_ids = None
|
17 |
if question:
|