Update modules/whisper/whisper_base.py
Browse files- modules/whisper/whisper_base.py +11 -11
modules/whisper/whisper_base.py
CHANGED
|
@@ -418,18 +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 |
|
| 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"]
|
| 435 |
|
|
@@ -637,6 +636,7 @@ class WhisperBase(ABC):
|
|
| 637 |
outputdata = []
|
| 638 |
temp_inputdata = inputdata.split("#NEWLINE#")
|
| 639 |
for temp_line in temp_inputdata:
|
|
|
|
| 640 |
temp_line_list = []
|
| 641 |
temp_line_items = temp_line.split("#TAB#")
|
| 642 |
for temp_line_item in temp_line_items:
|
|
|
|
| 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 += "#TAB#"+"#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 |
|
|
|
|
| 636 |
outputdata = []
|
| 637 |
temp_inputdata = inputdata.split("#NEWLINE#")
|
| 638 |
for temp_line in temp_inputdata:
|
| 639 |
+
temp_line += "#TAB#" #Add columnn for downloads
|
| 640 |
temp_line_list = []
|
| 641 |
temp_line_items = temp_line.split("#TAB#")
|
| 642 |
for temp_line_item in temp_line_items:
|