ADITYA commited on
Commit
99bdf0c
1 Parent(s): 0ab6fa1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,6 +3,7 @@ import os
3
  import tempfile
4
  from openai import OpenAI
5
 
 
6
 
7
  def tts(text, model, voice, api_key):
8
  if api_key == '':
@@ -33,9 +34,8 @@ def tts(text, model, voice, api_key):
33
 
34
 
35
  with gr.Blocks() as demo:
36
- gr.Markdown("## <center> OpenAI Text-To-Speech</center>")
37
  with gr.Row(variant='panel'):
38
- api_key = gr.Textbox(type='password', label='OpenAI API Key', placeholder='Enter your API key to access the TTS demo')
39
  model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
40
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
41
 
 
3
  import tempfile
4
  from openai import OpenAI
5
 
6
+ api_key = os.getenv('apikey')
7
 
8
  def tts(text, model, voice, api_key):
9
  if api_key == '':
 
34
 
35
 
36
  with gr.Blocks() as demo:
37
+ gr.Markdown("## OpenAI Text-To-Speech")
38
  with gr.Row(variant='panel'):
 
39
  model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
40
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
41