From 55e7c7854bba5182803239c903a0ac2d14426a4c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 9 May 2026 05:04:51 +0900 Subject: [PATCH] refac --- backend/open_webui/routers/audio.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/routers/audio.py b/backend/open_webui/routers/audio.py index 72ba2f6d03..5cf5de5aee 100644 --- a/backend/open_webui/routers/audio.py +++ b/backend/open_webui/routers/audio.py @@ -1190,7 +1190,12 @@ def transcribe(request: Request, file_path: str, metadata: Optional[dict] = None results = [] 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 futures = [ executor.submit(transcription_handler, request, chunk_path, metadata, user)