karan99300 commited on
Commit
a09bc7c
·
1 Parent(s): 76b3196

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -22,8 +22,11 @@ model.eval()
22
  def launch(input):
23
  im=Image.open(requests.get(input,stream=True).raw)
24
  image=transform(im.convert('RGB')).unsqueeze(0)
 
 
 
25
 
26
- return model.caption_image(image,dataset.vocab)
27
 
28
  iface=gr.Interface(launch,inputs="text",outputs="text")
29
  iface.launch()
 
22
  def launch(input):
23
  im=Image.open(requests.get(input,stream=True).raw)
24
  image=transform(im.convert('RGB')).unsqueeze(0)
25
+
26
+ output=model.caption_image(image,dataset.vocab)
27
+ str=" ".join(output[1:-1])
28
 
29
+ return str
30
 
31
  iface=gr.Interface(launch,inputs="text",outputs="text")
32
  iface.launch()