prakashkota commited on
Commit
ef3a189
·
verified ·
1 Parent(s): 5ce3bff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -11,16 +11,16 @@
11
  import gradio as gr
12
  from transformers import pipeline
13
 
14
- pipe = pipeline("image-to-text",
15
  model="./models/Salesforce/blip-image-captioning-base")
16
 
17
- def launch(input):
18
  out = pipe(input)
19
  return out[0]['generated_text']
20
 
21
- iface = gr.Interface(launch,
22
  inputs=gr.Image(type='pil'),
23
  outputs="text")
24
 
25
- iface.launch()
26
 
 
11
  import gradio as gr
12
  from transformers import pipeline
13
 
14
+ pipe = pipeline("image-to-text",
15
  model="./models/Salesforce/blip-image-captioning-base")
16
 
17
+ def launch(input):
18
  out = pipe(input)
19
  return out[0]['generated_text']
20
 
21
+ iface = gr.Interface(launch,
22
  inputs=gr.Image(type='pil'),
23
  outputs="text")
24
 
25
+ iface.launch()
26