Sangmin commited on
Commit
fa14696
1 Parent(s): 5bb29bc

Add a line to inform the character limit

Browse files

Currently the TTS model can handle upto 4096 characters

Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -10,7 +10,7 @@ client = OpenAI() # add api_key
10
 
11
  def tts(text, model, voice):
12
  response = client.audio.speech.create(
13
- model=model, #"tts-1","tts-1-hd"
14
  voice=voice, #'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'
15
  input=text,
16
  )
@@ -27,8 +27,9 @@ def tts(text, model, voice):
27
 
28
  with gr.Blocks() as demo:
29
  gr.Markdown("# <center> OpenAI Text-To-Speech API </center>")
 
30
  with gr.Row():
31
- model = gr.Dropdown(choices=['tts-1-1106','tts-1-hd-1106'], label='Model', value='tts-1')
32
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
33
 
34
  text = gr.Textbox(label="Input text", placeholder="Input text and press the Text-To-Speech button or press Enter.")
 
10
 
11
  def tts(text, model, voice):
12
  response = client.audio.speech.create(
13
+ model=model, #"tts-1-1106","tts-1-hd-1106"
14
  voice=voice, #'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'
15
  input=text,
16
  )
 
27
 
28
  with gr.Blocks() as demo:
29
  gr.Markdown("# <center> OpenAI Text-To-Speech API </center>")
30
+ gr.Markdown("## <center> Enter fewer than 4096 characters </center>")
31
  with gr.Row():
32
+ model = gr.Dropdown(choices=['tts-1-1106','tts-1-hd-1106'], label='Model', value='tts-1-1106')
33
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
34
 
35
  text = gr.Textbox(label="Input text", placeholder="Input text and press the Text-To-Speech button or press Enter.")