jonathanagustin commited on
Commit
539d552
1 Parent(s): 7a15797

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -43,8 +43,8 @@ def tts(
43
  try:
44
  # Create the audio speech object
45
  speech_file = openai.audio.speech.create(
46
- model=model,
47
- voice=voice,
48
  input=input_text,
49
  response_format=response_format,
50
  speed=speed,
@@ -71,7 +71,7 @@ def main():
71
  Main function to create and launch the Gradio interface.
72
  """
73
  MODEL_OPTIONS = ["tts-1", "tts-1-hd"]
74
- VOICE_OPTIONS = ["alloy", "echo", "fable", "onyx", "nova", "shimmer"]
75
  RESPONSE_FORMAT_OPTIONS = ["mp3", "opus", "aac", "flac", "wav", "pcm"]
76
  VOICE_PREVIEW_FILES = {voice: f"{voice}.wav" for voice in VOICE_OPTIONS}
77
 
@@ -246,7 +246,7 @@ def main():
246
  :rtype: str
247
  """
248
  audio_file = tts(
249
- input_text, model, voice, api_key, response_format, speed
250
  )
251
  return audio_file
252
 
 
43
  try:
44
  # Create the audio speech object
45
  speech_file = openai.audio.speech.create(
46
+ model=model.lower(),
47
+ voice=voice.lower(),
48
  input=input_text,
49
  response_format=response_format,
50
  speed=speed,
 
71
  Main function to create and launch the Gradio interface.
72
  """
73
  MODEL_OPTIONS = ["tts-1", "tts-1-hd"]
74
+ VOICE_OPTIONS = ["Alloy", "Echo", "Fable", "Onyx", "Nova", "Shimmer"]
75
  RESPONSE_FORMAT_OPTIONS = ["mp3", "opus", "aac", "flac", "wav", "pcm"]
76
  VOICE_PREVIEW_FILES = {voice: f"{voice}.wav" for voice in VOICE_OPTIONS}
77
 
 
246
  :rtype: str
247
  """
248
  audio_file = tts(
249
+ input_text, model.lower(), voice.lower(), api_key, response_format, speed
250
  )
251
  return audio_file
252