Codeblockz commited on
Commit
7ee96d5
·
verified ·
1 Parent(s): 816521f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("image-to-text",
6
+ model="./models/Salesforce/blip-image-captioning-base")
7
+ tts_pipe = pipeline("text-to-speech",
8
+ model="./models/kakao-enterprise/vits-ljs")
9
+
10
+ def launch(input):
11
+ out = pipe(input)
12
+ return out[0]['generated_text']
13
+
14
+ iface = gr.Interface(launch,
15
+ inputs=gr.Image(type='pil'),
16
+ outputs="text")
17
+ iface.lauch()
18
+
19
+