File size: 507 Bytes
cca9a4c
18d8458
cca9a4c
18d8458
1be9167
18d8458
 
1be9167
 
 
18d8458
 
 
712ba88
1be9167
18d8458
 
 
 
 
12a6969
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from transformers import pipeline

captioner = pipeline(model="microsoft/git-base")
tts = pipeline(model="suno/bark-small")

def predict(image):
    text = captioner(image)[0]["generated_text"]
    audio = tts(text)["audio"]
    return text, audio

demo = gr.Interface(
    fn=predict,
    inputs=gr.Image(type="pil"),
    outputs=['text', gr.Audio()]
)

demo.launch()

# gr.Interface.load("models/ronniet/git-base-env").launch()
# gr.Interface.load("models/microsoft/git-base").launch()