Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def predict(image: Image.Image, question: str) -> str:
|
|
18 |
text = f"Please answer the question. Question: {question} Answer:" if '?' in question else question
|
19 |
input_ids = model.text_transform(text).input_ids.to(device)
|
20 |
|
21 |
-
with torch.autocast(device_type=device, dtype=torch.
|
22 |
generated_ids = model.generate(
|
23 |
pixel_values=pixel_values,
|
24 |
input_ids=input_ids,
|
|
|
18 |
text = f"Please answer the question. Question: {question} Answer:" if '?' in question else question
|
19 |
input_ids = model.text_transform(text).input_ids.to(device)
|
20 |
|
21 |
+
with torch.autocast(device_type=device, dtype=torch.bfloat16):
|
22 |
generated_ids = model.generate(
|
23 |
pixel_values=pixel_values,
|
24 |
input_ids=input_ids,
|