LAP-DEV commited on
Commit
224c4fc
·
verified ·
1 Parent(s): 08cb115

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +10 -7
modules/whisper/whisper_base.py CHANGED
@@ -418,14 +418,17 @@ class WhisperBase(ABC):
418
  title_line += f'\n{tabbed_space}Language:\t{info["lang"]} (probability {info["lang_prob"]}%)'
419
  if params.is_translate: title_line += f'\n{tabbed_space}Translation:\t{info["transcription"]} (Handled by OpenAI Whisper)'
420
  if translate_output: title_line += f'\n{tabbed_space}Translation:\t{info["translation"]} (Handled by Facebook NLLB)'
421
- title_line += "#NEWLINE#"
422
-
423
  for temp_file in files_to_download.items():
424
- print("test:")
425
- temp1 = str(temp_file[0].split("_")[0])
426
- temp2 = str((temp_file[1])["path"])
427
- print("temp1: "+temp1)
428
- print("temp2: "+temp2)
 
 
 
429
 
430
  total_result += title_line+(((info["subtitle"].rstrip("\n")).replace("\t","#TAB#")).replace("\n","#NEWLINE#"))
431
  total_time += info["time_for_task"]
 
418
  title_line += f'\n{tabbed_space}Language:\t{info["lang"]} (probability {info["lang_prob"]}%)'
419
  if params.is_translate: title_line += f'\n{tabbed_space}Translation:\t{info["transcription"]} (Handled by OpenAI Whisper)'
420
  if translate_output: title_line += f'\n{tabbed_space}Translation:\t{info["translation"]} (Handled by Facebook NLLB)'
421
+
422
+ html_code = ""
423
  for temp_file in files_to_download.items():
424
+ dl_file = str(temp_file[0].split("_")[0])
425
+ dl_type = str(temp_file[0].split("_")[1])
426
+ dl_link = str((temp_file[1])["path"])
427
+ if dl_file == file_name:
428
+ if html_code != "": html_code+=" "
429
+ html_code += "<a href=''"+dl_link+"'>"+dl_type+"</a>"
430
+
431
+ title_line += "#TAB#"+html_code+"#NEWLINE#"
432
 
433
  total_result += title_line+(((info["subtitle"].rstrip("\n")).replace("\t","#TAB#")).replace("\n","#NEWLINE#"))
434
  total_time += info["time_for_task"]