Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -286,8 +286,10 @@ class WhisperBase(ABC):
|
|
| 286 |
Output file path to return to gr.Files()
|
| 287 |
"""
|
| 288 |
|
|
|
|
| 289 |
if input_multi != "Single":
|
| 290 |
files = files_multi
|
|
|
|
| 291 |
|
| 292 |
try:
|
| 293 |
if input_folder_path:
|
|
@@ -384,10 +386,16 @@ class WhisperBase(ABC):
|
|
| 384 |
total_result = ""
|
| 385 |
total_info = ""
|
| 386 |
total_time = 0
|
|
|
|
| 387 |
for file_name, info in files_info.items():
|
| 388 |
total_result += f'{info["subtitle"]}'
|
| 389 |
|
| 390 |
total_time += info["time_for_task"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
total_info += f'Media file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
|
| 392 |
|
| 393 |
if params.is_translate:
|
|
|
|
| 286 |
Output file path to return to gr.Files()
|
| 287 |
"""
|
| 288 |
|
| 289 |
+
file_count_total = 0
|
| 290 |
if input_multi != "Single":
|
| 291 |
files = files_multi
|
| 292 |
+
file_count_total = len(files)
|
| 293 |
|
| 294 |
try:
|
| 295 |
if input_folder_path:
|
|
|
|
| 386 |
total_result = ""
|
| 387 |
total_info = ""
|
| 388 |
total_time = 0
|
| 389 |
+
file_count = 0
|
| 390 |
for file_name, info in files_info.items():
|
| 391 |
total_result += f'{info["subtitle"]}'
|
| 392 |
|
| 393 |
total_time += info["time_for_task"]
|
| 394 |
+
|
| 395 |
+
if file_count += 1
|
| 396 |
+
if file_count > 1:
|
| 397 |
+
total_info += f'\n'
|
| 398 |
+
|
| 399 |
total_info += f'Media file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
|
| 400 |
|
| 401 |
if params.is_translate:
|