Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -43,10 +43,11 @@ def VQA(image,text):
|
|
43 |
outputs = VQA_model(**encoding)
|
44 |
logits = outputs.logits
|
45 |
idx = logits.argmax(-1).item()
|
46 |
-
output=[]
|
47 |
-
for item in VQA_model.config.id2label[idx]:
|
48 |
-
|
49 |
-
return output
|
|
|
50 |
|
51 |
iface = gr.Interface(fn=VQA, inputs=["image","text"], outputs="text")
|
52 |
iface.launch(share=False)
|
|
|
43 |
outputs = VQA_model(**encoding)
|
44 |
logits = outputs.logits
|
45 |
idx = logits.argmax(-1).item()
|
46 |
+
# output=[]
|
47 |
+
# for item in VQA_model.config.id2label[idx]:
|
48 |
+
# output.append(run_en_fa_transaltion_model(item))
|
49 |
+
#return output
|
50 |
+
return VQA_model.config.id2label[idx]
|
51 |
|
52 |
iface = gr.Interface(fn=VQA, inputs=["image","text"], outputs="text")
|
53 |
iface.launch(share=False)
|