LAP-DEV commited on
Commit
ab0438c
·
verified ·
1 Parent(s): 5cd0eca

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +5 -1
modules/whisper/whisper_base.py CHANGED
@@ -417,7 +417,11 @@ class WhisperBase(ABC):
417
  if params.is_translate: title_line += f'\n{tabbed_space}Translation:\t{info["transcription"]} (Handled by OpenAI Whisper)'
418
  if translate_output: title_line += f'\n{tabbed_space}Translation:\t{info["translation"]} (Handled by Facebook NLLB)'
419
 
420
- total_result += title_line+"#NEWLINE#"+(((info["subtitle"].rstrip("\n")).replace("\t","#TAB#")).replace("\n","#NEWLINE#"))
 
 
 
 
421
  total_time += info["time_for_task"]
422
 
423
  time_end = datetime.now()
 
417
  if params.is_translate: title_line += f'\n{tabbed_space}Translation:\t{info["transcription"]} (Handled by OpenAI Whisper)'
418
  if translate_output: title_line += f'\n{tabbed_space}Translation:\t{info["translation"]} (Handled by Facebook NLLB)'
419
 
420
+ temp_subtitle = info["subtitle"]
421
+ if temp_subtitle.strip() == "":
422
+ temp_subtitle = "(No speech detected)"
423
+
424
+ total_result += title_line+"#NEWLINE#"+(((temp_subtitle.rstrip("\n")).replace("\t","#TAB#")).replace("\n","#NEWLINE#"))
425
  total_time += info["time_for_task"]
426
 
427
  time_end = datetime.now()