muhammadsaadgondal commited on
Commit
1443bbb
·
verified ·
1 Parent(s): 1063d7a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ !pip install gradio
3
+
4
+ pipe=pipeline("image-to-text",model="Salesforce/blip-image-captioning-base")
5
+
6
+ def launch(input):
7
+ output=pipe(input)
8
+ return output[0]['generated_text']
9
+
10
+ iface=gr.Interface(
11
+ fn=launch,
12
+ inputs=gr.Image(type='pil'),
13
+ outputs="text"
14
+ )
15
+
16
+ iface.launch()
17
+