File size: 442 Bytes
03fc43e
8d12a0e
03fc43e
73316e5
 
03fc43e
 
 
d65de17
55b66e4
d65de17
0b2fc35
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gr
from transformers import VitsModel, AutoTokenizer,pipeline
import torch


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) 
   return pipe(text)
iface = gr.Interface(fn=TTS, inputs="text", outputs="text")
iface.launch(share=Flase)