Ver código fonte

feat:修改generate_long的并发逻辑

zhaohaipeng 2 meses atrás
pai
commit
ecb04ca8d1
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      fish_speech/models/text2semantic/inference.py

+ 1 - 1
fish_speech/models/text2semantic/inference.py

@@ -995,7 +995,7 @@ def generate_long_batched(
 
         results = {}
 
-        with ThreadPoolExecutor(max_workers=3) as executor:
+        with ThreadPoolExecutor(max_workers=min(3, len(batches))) as executor:
             futures = [
                 executor.submit(run_one_batch, i, b)
                 for i, b in enumerate(batches)