From 06b31f51ebd619c58484fe09a25e18d6727dfb27 Mon Sep 17 00:00:00 2001 From: Quentin Fuxa Date: Thu, 30 Oct 2025 23:30:19 +0100 Subject: [PATCH] exception when translation and no nllw --- whisperlivekit/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/whisperlivekit/core.py b/whisperlivekit/core.py index f5a4173..d25bb86 100644 --- a/whisperlivekit/core.py +++ b/whisperlivekit/core.py @@ -141,7 +141,10 @@ class TranscriptionEngine: if self.args.lan == 'auto' and self.args.backend != "simulstreaming": raise Exception('Translation cannot be set with language auto when transcription backend is not simulstreaming') else: - from nllw import load_model + try: + from nllw import load_model + except: + raise Exception('To use translation, you must install nllw: `pip install nllw`') translation_params = { "nllb_backend": "transformers", "nllb_size": "600M"