From 61e0d7c32c1596a8017ffe48c50213604e1519ca Mon Sep 17 00:00:00 2001
From: andimarafioti <andimarafioti@gmail.com>
Date: Fri, 30 Aug 2024 09:51:40 +0000
Subject: [PATCH] set default back to english

---
 STT/whisper_stt_handler.py                 | 2 ++
 arguments_classes/whisper_stt_arguments.py | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/STT/whisper_stt_handler.py b/STT/whisper_stt_handler.py
index e3c99bd..d669e34 100644
--- a/STT/whisper_stt_handler.py
+++ b/STT/whisper_stt_handler.py
@@ -40,6 +40,8 @@ class WhisperSTTHandler(BaseHandler):
         self.torch_dtype = getattr(torch, torch_dtype)
         self.compile_mode = compile_mode
         self.gen_kwargs = gen_kwargs
+        if language == 'None':
+            language = None
         self.last_language = language
         if self.last_language is not None:
             self.gen_kwargs["language"] = self.last_language
diff --git a/arguments_classes/whisper_stt_arguments.py b/arguments_classes/whisper_stt_arguments.py
index ec2f400..7073e29 100644
--- a/arguments_classes/whisper_stt_arguments.py
+++ b/arguments_classes/whisper_stt_arguments.py
@@ -59,8 +59,12 @@ class WhisperSTTHandlerArguments:
         },
     )
     language: Optional[str] = field(
-        default=None,
+        default='en',
         metadata={
-            "help": "The language for the conversation. Default is None."
+            "help": """The language for the conversation. 
+            Choose between 'en' (english), 'fr' (french), 'es' (spanish), 
+            'zh' (chinese), 'ko' (korean), 'ja' (japanese), or 'None'.
+            If using None, the language is automatically detected and can
+            change during the conversation. Default is 'en'."""
         },
     )
\ No newline at end of file
-- 
GitLab