From 36b6b8412998b057ae0257a229c044c4b03110de Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 15 Jun 2026 04:06:14 +0200 Subject: [PATCH] Fix KMP duplicate lib error on macOS for dependencies (PyTorch/FAISS) --- backend/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/__init__.py b/backend/__init__.py index e69de29..545ad32 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -0,0 +1,8 @@ +import os +import sys + + +# The macOS wheels for PyTorch (used by Whisper) and FAISS bundle different +# libomp copies. FAISS aborts the process when its copy initializes second. +if sys.platform == "darwin": + os.environ.setdefault("KMP_DUPLICATE_LIB_OK", "TRUE")