Spaces:
Running
Running
seawolf2357
commited on
Commit
Β·
02665d5
1
Parent(s):
f3d41cc
Update app.py
Browse files
app.py
CHANGED
@@ -28,9 +28,15 @@ def generate_audio(text, voice_name):
|
|
28 |
response = requests.post(url, json=payload, headers=headers, stream=True)
|
29 |
|
30 |
if response.status_code == 200:
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
else:
|
33 |
raise Exception(f"μ€λ₯ λ°μ. μν μ½λ: {response.status_code}")
|
|
|
|
|
34 |
|
35 |
# Gradio μΈν°νμ΄μ€ μ μ
|
36 |
with gr.Blocks() as demo:
|
|
|
28 |
response = requests.post(url, json=payload, headers=headers, stream=True)
|
29 |
|
30 |
if response.status_code == 200:
|
31 |
+
|
32 |
+
chunks = []
|
33 |
+
for chunk in response.iter_content(chunk_size=CHUNK_SIZE):
|
34 |
+
chunks.append(chunk)
|
35 |
+
return b''.join(chunks)
|
36 |
else:
|
37 |
raise Exception(f"μ€λ₯ λ°μ. μν μ½λ: {response.status_code}")
|
38 |
+
CHUNK_SIZE = 300
|
39 |
+
|
40 |
|
41 |
# Gradio μΈν°νμ΄μ€ μ μ
|
42 |
with gr.Blocks() as demo:
|