SeyedAli's picture
Update app.py
8d12a0e
raw
history blame
461 Bytes
import gradio as gr
from transformers import VitsModel, AutoTokenizer,pipeline
import torch
text = "من با ژاله جلسه داشتم."
def TTS(text):
model = VitsModel.from_pretrained("SeyedAli/Persian-Speech-synthesis")
tokenizer = AutoTokenizer.from_pretrained("SeyedAli/Persian-Speech-synthesis")
pipe = pipeline("text-to-speech", model=model,tokenizer=tokenizer)
iface = gr.Interface(fn=TTS, inputs=text, outputs=pipe(text))
iface.launch()