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)