tommy24 commited on
Commit
e7ee071
·
1 Parent(s): d4b7741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
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 "output.mp3"
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()