Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
-
from huggingface_space import Space
|
2 |
import gradio as gr
|
3 |
import requests
|
4 |
import os
|
5 |
|
6 |
-
space = Space(api_key=os.environ.get("test2"))
|
7 |
-
|
8 |
def text_to_speech(text):
|
9 |
test = os.environ.get("test")
|
10 |
endpoint = f"https://api.voicerss.org/?key={test}&src={text}&hl=en-us&v=Mike"
|
@@ -12,6 +9,6 @@ def text_to_speech(text):
|
|
12 |
with open("output.mp3", "wb") as f:
|
13 |
f.write(response.content)
|
14 |
space.upload_file("output.mp3", f)
|
15 |
-
return
|
16 |
|
17 |
gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
import os
|
4 |
|
|
|
|
|
5 |
def text_to_speech(text):
|
6 |
test = os.environ.get("test")
|
7 |
endpoint = f"https://api.voicerss.org/?key={test}&src={text}&hl=en-us&v=Mike"
|
|
|
9 |
with open("output.mp3", "wb") as f:
|
10 |
f.write(response.content)
|
11 |
space.upload_file("output.mp3", f)
|
12 |
+
return response.content
|
13 |
|
14 |
gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()
|