Spaces:
Runtime error
Runtime error
jonathanagustin
commited on
Commit
•
ef02dcd
1
Parent(s):
c455349
Upload folder using huggingface_hub
Browse files
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 |
-
|
64 |
-
|
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}")
|