Update app.py
Browse files
app.py
CHANGED
|
@@ -129,7 +129,7 @@ def validate_response(response):
|
|
| 129 |
|
| 130 |
def generate_text(prompt):
|
| 131 |
logger.info(f"Generating text for prompt: '{prompt}'")
|
| 132 |
-
max_retries =
|
| 133 |
for attempt in range(max_retries):
|
| 134 |
try:
|
| 135 |
response = client.chat.completions.create(
|
|
@@ -249,7 +249,7 @@ def process_prompt(prompt):
|
|
| 249 |
for speaker, text in item.items()]
|
| 250 |
|
| 251 |
audio_files = []
|
| 252 |
-
with ThreadPoolExecutor(max_workers=
|
| 253 |
futures = [executor.submit(process_line, task) for task in tasks]
|
| 254 |
for future in as_completed(futures):
|
| 255 |
result = future.result()
|
|
|
|
| 129 |
|
| 130 |
def generate_text(prompt):
|
| 131 |
logger.info(f"Generating text for prompt: '{prompt}'")
|
| 132 |
+
max_retries = 40
|
| 133 |
for attempt in range(max_retries):
|
| 134 |
try:
|
| 135 |
response = client.chat.completions.create(
|
|
|
|
| 249 |
for speaker, text in item.items()]
|
| 250 |
|
| 251 |
audio_files = []
|
| 252 |
+
with ThreadPoolExecutor(max_workers=2) as executor:
|
| 253 |
futures = [executor.submit(process_line, task) for task in tasks]
|
| 254 |
for future in as_completed(futures):
|
| 255 |
result = future.result()
|