SeyedAli commited on
Commit
03fc43e
1 Parent(s): e354b9c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import VitsModel, AutoTokenizer
3
+ import torch
4
+ def TTS(text):
5
+ model = VitsModel.from_pretrained("SeyedAli/Persian-Speech-synthesis")
6
+ tokenizer = AutoTokenizer.from_pretrained("SeyedAli/Persian-Speech-synthesis")
7
+ pipe = pipeline("text-to-speech", model=model,tokenizer=tokenizer)
8
+ text = "من با ژاله جلسه داشتم."
9
+
10
+ iface = gr.Interface(fn=TTS, inputs=text, outputs=pipe(text))
11
+ iface.launch()