Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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()
|