LAP-DEV commited on
Commit
7fab104
·
verified ·
1 Parent(s): 6a07dda

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +11 -9
modules/whisper/whisper_base.py CHANGED
@@ -418,17 +418,19 @@ 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
- # html_code = ""
424
- # for temp_file in files_to_download.items():
425
- # dl_file = str(temp_file[0].split("_")[0])
426
- # dl_type = str(temp_file[0].split("_")[1])
427
- # dl_link = str((temp_file[1])["path"])
428
- # if dl_file == file_name:
429
- # if html_code != "": html_code+=" "
430
- # html_code += "<a href=''"+dl_link+"'>"+dl_type+"</a>"
431
-
432
  total_result += title_line+(((info["subtitle"].rstrip("\n")).replace("\t","#TAB#")).replace("\n","#NEWLINE#"))
433
  total_time += info["time_for_task"]
434
 
 
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
+ dl_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 dl_code != "": dl_code+=" "
429
+ dl_code += "["+dl_type+"]("dl_link+")"
430
+ title_line += f'{tabbed_space}Download file:"\t{dl_code}'
431
+
432
  title_line += "#NEWLINE#"
433
 
 
 
 
 
 
 
 
 
 
434
  total_result += title_line+(((info["subtitle"].rstrip("\n")).replace("\t","#TAB#")).replace("\n","#NEWLINE#"))
435
  total_time += info["time_for_task"]
436