Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import scipy.io.wavfile as wav
|
|
6 |
import numpy as np
|
7 |
import wave
|
8 |
from datasets import load_dataset, Audio, config
|
|
|
9 |
|
10 |
# Load the TTS model from the Hugging Face Hub
|
11 |
checkpoint = "arham061/speecht5_finetuned_voxpopuli_nl" # Replace with your actual model name
|
@@ -101,12 +102,7 @@ def text_to_speech(text):
|
|
101 |
# Generate audio
|
102 |
audio_output = generate_audio(text)
|
103 |
|
104 |
-
|
105 |
-
from IPython.display import Audio
|
106 |
-
|
107 |
-
audio = Audio(audio_output.numpy(), rate=16000)
|
108 |
-
|
109 |
-
return audio
|
110 |
|
111 |
# Define the Gradio interface
|
112 |
inputs = gr.inputs.Textbox(label="Enter text in Urdu")
|
|
|
6 |
import numpy as np
|
7 |
import wave
|
8 |
from datasets import load_dataset, Audio, config
|
9 |
+
from IPython.display import Audio
|
10 |
|
11 |
# Load the TTS model from the Hugging Face Hub
|
12 |
checkpoint = "arham061/speecht5_finetuned_voxpopuli_nl" # Replace with your actual model name
|
|
|
102 |
# Generate audio
|
103 |
audio_output = generate_audio(text)
|
104 |
|
105 |
+
return Audio(audio_output.numpy(), rate=16000)
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
# Define the Gradio interface
|
108 |
inputs = gr.inputs.Textbox(label="Enter text in Urdu")
|