m6011 commited on
Commit
99c6dce
1 Parent(s): 8c93826

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,9 +1,9 @@
1
  import gradio as gr
2
- from transformers import Tacotron2Processor, Tacotron2ForConditionalGeneration
3
 
4
  # تحميل النموذج والمعالج
5
- processor = Tacotron2Processor.from_pretrained("facebook/tacotron2")
6
- model = Tacotron2ForConditionalGeneration.from_pretrained("facebook/tacotron2")
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()