Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -413,13 +413,13 @@ class WhisperBase(ABC):
|
|
| 413 |
title_line = ""
|
| 414 |
if add_timestamp_preview: title_line += "□"
|
| 415 |
if diarize_speakers: title_line += "□"
|
| 416 |
-
title_line += f'
|
| 417 |
title_line += f'\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)'
|
| 418 |
if params.is_translate: title_line += f'\nTranslation:\t{info["transcription"]} (Handled by OpenAI Whisper)'
|
| 419 |
if translate_output: title_line += f'\nTranslation:\t{info["translation"]} (Handled by Facebook NLLB)'
|
| 420 |
title_line += "■"
|
| 421 |
|
| 422 |
-
temp_subtitle = info["subtitle"]
|
| 423 |
temp_subtitle = temp_subtitle.replace("\t","□")
|
| 424 |
temp_subtitle = temp_subtitle.replace("\n","■")
|
| 425 |
total_result += title_line+temp_subtitle
|
|
@@ -430,7 +430,7 @@ class WhisperBase(ABC):
|
|
| 430 |
#total_info += f"Total processing time:\t{self.format_time((time_end-time_start).total_seconds())}"
|
| 431 |
total_info = f"Processed {file_count} {'file' if file_count == 1 else 'files'} in {self.format_time((time_end-time_start).total_seconds())}"
|
| 432 |
|
| 433 |
-
result_str = self.transform_text_to_list(total_result,"□","■")
|
| 434 |
result_file_path = [info['path'] for info in files_to_download.values()]
|
| 435 |
|
| 436 |
return [result_str,result_file_path,total_info]
|
|
|
|
| 413 |
title_line = ""
|
| 414 |
if add_timestamp_preview: title_line += "□"
|
| 415 |
if diarize_speakers: title_line += "□"
|
| 416 |
+
title_line += f'Media file:\t{info["input_source_file"]}'
|
| 417 |
title_line += f'\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)'
|
| 418 |
if params.is_translate: title_line += f'\nTranslation:\t{info["transcription"]} (Handled by OpenAI Whisper)'
|
| 419 |
if translate_output: title_line += f'\nTranslation:\t{info["translation"]} (Handled by Facebook NLLB)'
|
| 420 |
title_line += "■"
|
| 421 |
|
| 422 |
+
temp_subtitle = info["subtitle"]
|
| 423 |
temp_subtitle = temp_subtitle.replace("\t","□")
|
| 424 |
temp_subtitle = temp_subtitle.replace("\n","■")
|
| 425 |
total_result += title_line+temp_subtitle
|
|
|
|
| 430 |
#total_info += f"Total processing time:\t{self.format_time((time_end-time_start).total_seconds())}"
|
| 431 |
total_info = f"Processed {file_count} {'file' if file_count == 1 else 'files'} in {self.format_time((time_end-time_start).total_seconds())}"
|
| 432 |
|
| 433 |
+
result_str = self.transform_text_to_list(total_result.rstrip("\n"),"□","■") #Transform to gr.Dataframe format
|
| 434 |
result_file_path = [info['path'] for info in files_to_download.values()]
|
| 435 |
|
| 436 |
return [result_str,result_file_path,total_info]
|