Muhammad Noman commited on
Commit
c5b1e5d
·
1 Parent(s): 2f0bda5

Reduce thread pool workers from 4 to 2 for 2-core optimization

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -310,7 +310,7 @@ async def generate_audio(text: str, voice: str = 'af_heart', speed: float = 1.0,
310
  start_time = time.time()
311
 
312
  loop = asyncio.get_event_loop()
313
- max_parallel = min(len(chunks), 4)
314
  with ThreadPoolExecutor(max_workers=max_parallel) as executor:
315
  tasks = []
316
  for i, chunk in enumerate(chunks):
@@ -584,7 +584,7 @@ async def generate_cloned_audio(text: str, voice_sample_base64: str, speed: floa
584
  logger.info(f"Split text into {len(chunks)} chunks for voice cloning")
585
 
586
  loop = asyncio.get_event_loop()
587
- max_parallel = min(len(chunks), 4)
588
 
589
  with ThreadPoolExecutor(max_workers=max_parallel) as executor:
590
  tasks = []
 
310
  start_time = time.time()
311
 
312
  loop = asyncio.get_event_loop()
313
+ max_parallel = min(len(chunks), 2)
314
  with ThreadPoolExecutor(max_workers=max_parallel) as executor:
315
  tasks = []
316
  for i, chunk in enumerate(chunks):
 
584
  logger.info(f"Split text into {len(chunks)} chunks for voice cloning")
585
 
586
  loop = asyncio.get_event_loop()
587
+ max_parallel = min(len(chunks), 2)
588
 
589
  with ThreadPoolExecutor(max_workers=max_parallel) as executor:
590
  tasks = []