Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
3 |
|
4 |
# تحميل النموذج والمعالج
|
5 |
-
|
6 |
-
|
7 |
|
8 |
def tts(text):
|
9 |
inputs = processor(text, return_tensors="pt")
|
@@ -11,5 +11,5 @@ def tts(text):
|
|
11 |
return processor.decode(speech[0])
|
12 |
|
13 |
# واجهة Gradio
|
14 |
-
iface = gr.Interface(fn=tts, inputs="text", outputs="audio", title="Najdi TTS Model")
|
15 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import FastSpeechForConditionalGeneration, Wav2Vec2Processor
|
3 |
|
4 |
# تحميل النموذج والمعالج
|
5 |
+
model = FastSpeechForConditionalGeneration.from_pretrained("facebook/fastspeech2-en-ljspeech")
|
6 |
+
processor = Wav2Vec2Processor.from_pretrained("facebook/fastspeech2-en-ljspeech")
|
7 |
|
8 |
def tts(text):
|
9 |
inputs = processor(text, return_tensors="pt")
|
|
|
11 |
return processor.decode(speech[0])
|
12 |
|
13 |
# واجهة Gradio
|
14 |
+
iface = gr.Interface(fn=tts, inputs="text", outputs="audio", title="FastSpeech2 Najdi TTS Model")
|
15 |
iface.launch()
|