import gradio as gr | |
import requests | |
# from pydub import AudioSegment | |
def function1(prompt): | |
response = requests.post("https://matthijs-speecht5-tts-demo.hf.space/run/predict", json={ | |
"data": [ | |
prompt, | |
"KSP (male)", | |
] | |
}).json() | |
data = response["data"][0]["name"] | |
data = "https://matthijs-speecht5-tts-demo.hf.space/file="+data | |
# audio = AudioSegment.from_wav(data).export("output.mp3", format="mp3") | |
return data | |
iface = gr.Interface(fn=function1, inputs="text", outputs="text") | |
iface.launch() |