Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import requests # Send HTTP GET request to Hugging Face models for inference.
|
|
9 |
|
10 |
HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
11 |
|
12 |
-
|
13 |
def text_to_speech(story):
|
14 |
# Model used here: "espnet/kan-bayashi_ljspeech_vits.
|
15 |
# Backup model: "facebook/mms-tts-eng".
|
@@ -36,14 +36,14 @@ def text_to_speech(text_response):
|
|
36 |
outputs = vits_model(**inputs)
|
37 |
|
38 |
scipy.io.wavfile.write("techno.wav", rate=vits_model.config.sampling_rate, data=output.float().numpy())
|
39 |
-
|
40 |
-
|
41 |
|
42 |
# Create a Gradio interface
|
43 |
iface = gr.Interface(
|
44 |
fn=text_to_speech,
|
45 |
inputs=gr.Textbox(lines=5, placeholder="Enter your text here..."),
|
46 |
-
outputs=gr.Audio("
|
47 |
)
|
48 |
|
49 |
# Launch the interface
|
|
|
9 |
|
10 |
HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
11 |
|
12 |
+
'''
|
13 |
def text_to_speech(story):
|
14 |
# Model used here: "espnet/kan-bayashi_ljspeech_vits.
|
15 |
# Backup model: "facebook/mms-tts-eng".
|
|
|
36 |
outputs = vits_model(**inputs)
|
37 |
|
38 |
scipy.io.wavfile.write("techno.wav", rate=vits_model.config.sampling_rate, data=output.float().numpy())
|
39 |
+
|
40 |
+
|
41 |
|
42 |
# Create a Gradio interface
|
43 |
iface = gr.Interface(
|
44 |
fn=text_to_speech,
|
45 |
inputs=gr.Textbox(lines=5, placeholder="Enter your text here..."),
|
46 |
+
outputs=gr.Audio("techno.wav")
|
47 |
)
|
48 |
|
49 |
# Launch the interface
|