ADITYA commited on
Commit
3ea2f39
1 Parent(s): 99bdf0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,7 +3,7 @@ import os
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 == '':
@@ -36,6 +36,7 @@ def tts(text, model, voice, api_key):
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
 
 
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 == '':
 
36
  with gr.Blocks() as demo:
37
  gr.Markdown("## OpenAI Text-To-Speech")
38
  with gr.Row(variant='panel'):
39
+ api_key = gr.Textbox(type='password', label='OpenAI API Key', placeholder='Enter your API key')
40
  model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
41
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
42