Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ def get_format_response(image,question,selected_model):
|
|
14 |
processor = processor.from_pretrained(model_name)
|
15 |
model = model_class.from_pretrained(model_name)
|
16 |
encoding = processor(image, question, return_tensors="pt")
|
17 |
-
outputs = model(**encoding)
|
18 |
if selected_model=='ViLT':
|
|
|
19 |
logits = outputs.logits
|
20 |
idx = logits.argmax(-1).item()
|
21 |
answer = model.config.id2label[idx]
|
|
|
14 |
processor = processor.from_pretrained(model_name)
|
15 |
model = model_class.from_pretrained(model_name)
|
16 |
encoding = processor(image, question, return_tensors="pt")
|
|
|
17 |
if selected_model=='ViLT':
|
18 |
+
outputs = model(**encoding)
|
19 |
logits = outputs.logits
|
20 |
idx = logits.argmax(-1).item()
|
21 |
answer = model.config.id2label[idx]
|