jonathanagustin commited on
Commit
772e8a8
1 Parent(s): 2c9d387

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -58,11 +58,9 @@ def tts(
58
  input=input_text,
59
  response_format=response_format,
60
  speed=speed,
61
- stream=True,
62
  ) as response:
63
- # Stream the response directly to the temp file
64
- for chunk in response:
65
- temp_file.write(chunk)
66
  except openai.OpenAIError as e:
67
  # Catch OpenAI exceptions
68
  raise gr.Error(f"An OpenAI error occurred: {e}")
 
58
  input=input_text,
59
  response_format=response_format,
60
  speed=speed,
 
61
  ) as response:
62
+ response.stream_to_file(temp_file_path)
63
+
 
64
  except openai.OpenAIError as e:
65
  # Catch OpenAI exceptions
66
  raise gr.Error(f"An OpenAI error occurred: {e}")