Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,11 +8,12 @@ warnings.filterwarnings("ignore", message="Using the model-agnostic default `max
|
|
| 8 |
from transformers import BlipForQuestionAnswering
|
| 9 |
from transformers import AutoProcessor
|
| 10 |
|
| 11 |
-
def qa(
|
| 12 |
model = BlipForQuestionAnswering.from_pretrained(
|
| 13 |
"./models/Salesforce/blip-vqa-base")
|
| 14 |
processor = AutoProcessor.from_pretrained(
|
| 15 |
"./models/Salesforce/blip-vqa-base")
|
|
|
|
| 16 |
inputs = processor(image, question, return_tensors="pt")
|
| 17 |
|
| 18 |
out = model.generate(**inputs)
|
|
|
|
| 8 |
from transformers import BlipForQuestionAnswering
|
| 9 |
from transformers import AutoProcessor
|
| 10 |
|
| 11 |
+
def qa(image, question):
|
| 12 |
model = BlipForQuestionAnswering.from_pretrained(
|
| 13 |
"./models/Salesforce/blip-vqa-base")
|
| 14 |
processor = AutoProcessor.from_pretrained(
|
| 15 |
"./models/Salesforce/blip-vqa-base")
|
| 16 |
+
|
| 17 |
inputs = processor(image, question, return_tensors="pt")
|
| 18 |
|
| 19 |
out = model.generate(**inputs)
|