Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ def generate_answer_git(processor, model, image, question):
|
|
46 |
|
47 |
def generate_answer_blip(processor, model, image, question):
|
48 |
# prepare image + question
|
49 |
-
inputs = processor(images=image, text=
|
50 |
|
51 |
generated_ids = model.generate(**inputs, max_length=50)
|
52 |
generated_answer = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
@@ -56,7 +56,7 @@ def generate_answer_blip(processor, model, image, question):
|
|
56 |
|
57 |
def generate_answer_vilt(processor, model, image, question):
|
58 |
# prepare image + question
|
59 |
-
encoding = processor(image, text, return_tensors="pt")
|
60 |
|
61 |
with torch.no_grad():
|
62 |
outputs = model(**encoding)
|
|
|
46 |
|
47 |
def generate_answer_blip(processor, model, image, question):
|
48 |
# prepare image + question
|
49 |
+
inputs = processor(images=image, text=question, return_tensors="pt")
|
50 |
|
51 |
generated_ids = model.generate(**inputs, max_length=50)
|
52 |
generated_answer = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
|
|
56 |
|
57 |
def generate_answer_vilt(processor, model, image, question):
|
58 |
# prepare image + question
|
59 |
+
encoding = processor(images=image, text=question, return_tensors="pt")
|
60 |
|
61 |
with torch.no_grad():
|
62 |
outputs = model(**encoding)
|