|
import os |
|
import gradio as gr |
|
import zipfile |
|
|
|
|
|
os.system('wget -q https://storage.googleapis.com/vakyansh-open-models/tts/marathi/mr-IN/female_voice_0/glow.zip && unzip -q glow.zip -d ttsv/checkpoints/female') |
|
os.system('wget -q https://storage.googleapis.com/vakyansh-open-models/tts/marathi/mr-IN/female_voice_0/hifi.zip && unzip -q hifi.zip -d ttsv/checkpoints/female') |
|
os.system('rm glow.zip && rm hifi.zip') |
|
os.system('wget -q https://storage.googleapis.com/vakyansh-open-models/translit_models.zip -P ttsv/checkpoints/ && unzip -q ttsv/checkpoints/translit_models.zip -d ttsv/checkpoints/') |
|
|
|
|
|
def run_tts(text, language): |
|
|
|
|
|
|
|
audio_data = "Base64-encoded-audio-data" |
|
return audio_data |
|
|
|
|
|
def text_to_speech(text): |
|
audio_data = run_tts(text, language="mr") |
|
return audio_data |
|
|
|
iface = gr.Interface(fn=text_to_speech, inputs="text", outputs="audio") |
|
iface.launch() |
|
|