From b8e3ea026d448a59a0d5d75cdc9bf2421dd8cd6d Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:29:28 -0600 Subject: [PATCH] Clarified when language is being forced --- subgen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subgen.py b/subgen.py index c63b274..5643183 100644 --- a/subgen.py +++ b/subgen.py @@ -439,6 +439,7 @@ async def asr( if force_detected_language_to: language = force_detected_language_to + logging.info(f"ENV FORCE_DETECTED_LANGUAGE_TO is set: Forcing detected language to {force_language}") start_time = time.time() start_model() @@ -482,6 +483,7 @@ async def detect_language( ): detected_language = "" # Initialize with an empty string language_code = "" # Initialize with an empty string + logging.info(f"ENV FORCE_DETECTED_LANGUAGE_TO is set to {force_language}, the language detected from this call will be ignored in /ASR calls") if int(detect_language_length) != 30: logging.info(f"Detect language is set to detect on the first {detect_language_length} seconds of the audio.") try: @@ -547,10 +549,10 @@ def gen_subtitles(file_path: str, transcription_type: str, force_language=None) start_model() if force_language: - logging.info(f"Forcing language to {force_language}") + logging.info(f"Forcing detected language to {force_language} from /batch endpoint") elif force_detected_language_to: force_language = force_detected_language_to - logging.info(f"Forcing language to {force_language}") + logging.info(f"ENV FORCE_DETECTED_LANGUAGE_TO is set: Forcing detected language to {force_language}") if custom_regroup: result = model.transcribe_stable(file_path, language=force_language, task=transcription_type,