Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
from numpy import int16,float32
|
2 |
-
import gradio as gr
|
3 |
-
from transformers import AutoModel
|
4 |
-
model = AutoModel.from_pretrained("
|
5 |
-
def synthesize_speech(text, ref_audio, ref_text):
|
6 |
-
audio = model(text, ref_audio_path=ref_audio, ref_text=ref_text)
|
7 |
-
if audio.dtype == int16:
|
8 |
-
audio = audio.astype(float32) / 32768.0
|
9 |
-
return 24000, audio
|
10 |
-
gr.Interface(synthesize_speech,[gr.Textbox(label="Text to Synthesize"), gr.Audio(type="filepath", label="Reference Prompt Audio"), gr.Textbox(label="Text in Reference Prompt Audio")], gr.Audio(label="Generated Speech", type="numpy")).launch()
|
|
|
1 |
+
from numpy import int16,float32
|
2 |
+
import gradio as gr
|
3 |
+
from transformers import AutoModel
|
4 |
+
model = AutoModel.from_pretrained("shethjenil/IndicF5", trust_remote_code=True).to("cpu")
|
5 |
+
def synthesize_speech(text, ref_audio, ref_text):
|
6 |
+
audio = model(text, ref_audio_path=ref_audio, ref_text=ref_text)
|
7 |
+
if audio.dtype == int16:
|
8 |
+
audio = audio.astype(float32) / 32768.0
|
9 |
+
return 24000, audio
|
10 |
+
gr.Interface(synthesize_speech,[gr.Textbox(label="Text to Synthesize"), gr.Audio(type="filepath", label="Reference Prompt Audio"), gr.Textbox(label="Text in Reference Prompt Audio")], gr.Audio(label="Generated Speech", type="numpy")).launch()
|