Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -418,12 +418,17 @@ class WhisperBase(ABC):
|
|
418 |
title_line = ""
|
419 |
if add_timestamp_preview: add_tabs += 1
|
420 |
if diarize_speakers: add_tabs += 1
|
421 |
-
title_line = (add_tabs*"
|
422 |
-
title_line += (add_tabs*"
|
423 |
-
if params.is_translate: title_line += f'Translation: {info["transcription"]} (Handled by OpenAI Whisper)\n'
|
424 |
-
if translate_output: title_line += f'Translation: {info["translation"]} (Handled by Facebook NLLB)\n'
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
|
426 |
-
total_result += title_line+info["subtitle"]
|
427 |
total_time += info["time_for_task"]
|
428 |
total_info += f'Media file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
|
429 |
|
@@ -640,10 +645,10 @@ class WhisperBase(ABC):
|
|
640 |
@staticmethod
|
641 |
def transform_text_to_list(inputdata: str) -> list:
|
642 |
outputdata = []
|
643 |
-
temp_inputdata = (inputdata.strip("\n")).
|
644 |
for temp_line in temp_inputdata:
|
645 |
temp_line_list = []
|
646 |
-
temp_line_items = temp_line.split("
|
647 |
for temp_line_item in temp_line_items:
|
648 |
temp_line_list.append(temp_line_item)
|
649 |
outputdata.append(temp_line_list)
|
|
|
418 |
title_line = ""
|
419 |
if add_timestamp_preview: add_tabs += 1
|
420 |
if diarize_speakers: add_tabs += 1
|
421 |
+
title_line = (add_tabs*"□")+f'Media file: {info["input_source_file"]}\n'
|
422 |
+
title_line += (add_tabs*"□")+f'Language: {info["lang"]} (probability {info["lang_prob"]}%)\n'
|
423 |
+
if params.is_translate: title_line += (add_tabs*"□")+f'Translation: {info["transcription"]} (Handled by OpenAI Whisper)\n'
|
424 |
+
if translate_output: title_line += (add_tabs*"□")+f'Translation: {info["translation"]} (Handled by Facebook NLLB)\n'
|
425 |
+
title_line += "■"
|
426 |
+
|
427 |
+
temp_subtitle = info["subtitle"]
|
428 |
+
temp_subtitle.replace("\t","□")
|
429 |
+
temp_subtitle.replace("\n","■")
|
430 |
+
total_result += title_line+temp_subtitle
|
431 |
|
|
|
432 |
total_time += info["time_for_task"]
|
433 |
total_info += f'Media file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
|
434 |
|
|
|
645 |
@staticmethod
|
646 |
def transform_text_to_list(inputdata: str) -> list:
|
647 |
outputdata = []
|
648 |
+
temp_inputdata = (inputdata.strip("\n")).split("■")
|
649 |
for temp_line in temp_inputdata:
|
650 |
temp_line_list = []
|
651 |
+
temp_line_items = temp_line.split("□")
|
652 |
for temp_line_item in temp_line_items:
|
653 |
temp_line_list.append(temp_line_item)
|
654 |
outputdata.append(temp_line_list)
|