commonman commited on
Commit
b53eb2f
·
1 Parent(s): c50a688

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -3,7 +3,7 @@
3
  import os
4
  import gradio as gr
5
  import openai
6
- from gtts import gTTS # Google Text To Speech
7
 
8
  # load the api key
9
  openai.api_key = os.environ["OPEN_AI_KEY"]
@@ -81,16 +81,16 @@ with gr.Blocks() as demo:
81
  # the converted text as an mp3 file
82
  # input from messages as a reference
83
  # output to GPT Voice - Audio Component
84
- def giveVoice(messages):
85
- bot_message=messages[-1]
86
-
87
- myobj = gTTS(text=bot_message["content"])
88
- myobj.save("temp.mp3")
89
-
90
- dir = os.getcwd()
91
- new_path = os.path.join(dir, "temp.mp3")
92
-
93
- return new_path
94
 
95
  # Creates the Gradio interface objects
96
  # The submit button triggers a cascade of
 
3
  import os
4
  import gradio as gr
5
  import openai
6
+ # from gtts import gTTS # Google Text To Speech
7
 
8
  # load the api key
9
  openai.api_key = os.environ["OPEN_AI_KEY"]
 
81
  # the converted text as an mp3 file
82
  # input from messages as a reference
83
  # output to GPT Voice - Audio Component
84
+ #def giveVoice(messages):
85
+ # bot_message=messages[-1]
86
+ #
87
+ # myobj = gTTS(text=bot_message["content"])
88
+ # myobj.save("temp.mp3")
89
+ #
90
+ # dir = os.getcwd()
91
+ # new_path = os.path.join(dir, "temp.mp3")
92
+ #
93
+ # return new_path
94
 
95
  # Creates the Gradio interface objects
96
  # The submit button triggers a cascade of