gpucce commited on
Commit
df25445
1 Parent(s): d3bc1ff
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,7 +10,7 @@ model, _, transform = open_clip.create_model_and_transforms(
10
  def output_generate(image):
11
  im = transform(image).unsqueeze(0)
12
  generated = model.generate(im)
13
- return open_clip.decode(generated).split("<end_of_text>")[0].replace("<start_of_text>", "")
14
 
15
- iface = gr.Interface(fn=output_generate, inputs=gr.Image(type="pil"), outputs="text")
16
  iface.launch()
 
10
  def output_generate(image):
11
  im = transform(image).unsqueeze(0)
12
  generated = model.generate(im)
13
+ return open_clip.decode(generated[0]).split("<end_of_text>")[0].replace("<start_of_text>", "")
14
 
15
+ iface = gr.Interface(fn=output_generate, inputs=gr.Ifimage(type="pil"), outputs="text")
16
  iface.launch()