refac
This commit is contained in:
1 parent
c978a788c8
commit
55e7c7854b
1 file changed
+6
-1
@@ -1190,7 +1190,12 @@ def transcribe(request: Request, file_path: str, metadata: Optional[dict] = None
|
|||||||
|
|
||||||
results = []
|
results = []
|
||||||
try:
|
try:
|
||||||
with ThreadPoolExecutor() as executor:
|
if getattr(request.app.state.config, "STT_ENGINE", "") == "":
|
||||||
|
max_workers = 1
|
||||||
|
else:
|
||||||
|
max_workers = None
|
||||||
|
|
||||||
|
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
||||||
# Submit tasks for each chunk_path
|
# Submit tasks for each chunk_path
|
||||||
futures = [
|
futures = [
|
||||||
executor.submit(transcription_handler, request, chunk_path, metadata, user)
|
executor.submit(transcription_handler, request, chunk_path, metadata, user)
|
||||||
|
|||||||
Reference in new issue
Block a user