Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ def predict(image: Image.Image, question: str) -> str:
|
|
15 |
|
16 |
input_ids = None
|
17 |
if question:
|
18 |
-
|
19 |
-
input_ids = model.text_transform(
|
20 |
|
21 |
generated_ids = model.generate(
|
22 |
pixel_values=pixel_values,
|
|
|
15 |
|
16 |
input_ids = None
|
17 |
if question:
|
18 |
+
prompt = f"Please answer the question. Question: {question} Answer:" if '?' in question else question
|
19 |
+
input_ids = model.text_transform(prompt).input_ids.to(device)
|
20 |
|
21 |
generated_ids = model.generate(
|
22 |
pixel_values=pixel_values,
|