Ahsen Khaliq commited on
Commit
c08ba31
1 Parent(s): c6a9352

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -58,7 +58,7 @@ def inference(raw_image, model_n, question):
58
  else:
59
  image_vq = transform_vq(raw_image).unsqueeze(0).to(device)
60
  with torch.no_grad():
61
- answer = model(image_vq, question, train=False, inference='generate')
62
  return 'answer: '+answer[0]
63
 
64
  inputs = [gr.inputs.Image(type='pil'),gr.inputs.Radio(choices=['Image Captioning',"Visual Question Answering"], type="value", default="Image Captioning", label="Model"),"textbox"]
 
58
  else:
59
  image_vq = transform_vq(raw_image).unsqueeze(0).to(device)
60
  with torch.no_grad():
61
+ answer = model_vq(image_vq, question, train=False, inference='generate')
62
  return 'answer: '+answer[0]
63
 
64
  inputs = [gr.inputs.Image(type='pil'),gr.inputs.Radio(choices=['Image Captioning',"Visual Question Answering"], type="value", default="Image Captioning", label="Model"),"textbox"]