Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -369,14 +369,13 @@ class WhisperBase(ABC):
|
|
369 |
)
|
370 |
files_to_download[file_name+"_csv"] = {"path": file_path}
|
371 |
|
372 |
-
total_result =
|
373 |
-
total_info =
|
374 |
total_time = 0
|
375 |
for file_name, info in files_info.items():
|
376 |
total_result += f'{info["subtitle"]}'
|
377 |
|
378 |
total_time += info["time_for_task"]
|
379 |
-
total_info += f'\n'
|
380 |
total_info += f'Input file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
|
381 |
|
382 |
if params.is_translate:
|
@@ -387,13 +386,7 @@ class WhisperBase(ABC):
|
|
387 |
|
388 |
time_end = datetime.now()
|
389 |
total_info += f"\nTotal processing time: {self.format_time((time_end-time_start).total_seconds())}"
|
390 |
-
|
391 |
result_str = total_result.rstrip("\n")
|
392 |
-
|
393 |
-
# Fix tab indents
|
394 |
-
total_info = total_info.expandtabs(8)
|
395 |
-
result_str = result_str.expandtabs(8)
|
396 |
-
|
397 |
result_file_path = [info['path'] for info in files_to_download.values()]
|
398 |
|
399 |
return [result_str,result_file_path,total_info]
|
|
|
369 |
)
|
370 |
files_to_download[file_name+"_csv"] = {"path": file_path}
|
371 |
|
372 |
+
total_result = ""
|
373 |
+
total_info = ""
|
374 |
total_time = 0
|
375 |
for file_name, info in files_info.items():
|
376 |
total_result += f'{info["subtitle"]}'
|
377 |
|
378 |
total_time += info["time_for_task"]
|
|
|
379 |
total_info += f'Input file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
|
380 |
|
381 |
if params.is_translate:
|
|
|
386 |
|
387 |
time_end = datetime.now()
|
388 |
total_info += f"\nTotal processing time: {self.format_time((time_end-time_start).total_seconds())}"
|
|
|
389 |
result_str = total_result.rstrip("\n")
|
|
|
|
|
|
|
|
|
|
|
390 |
result_file_path = [info['path'] for info in files_to_download.values()]
|
391 |
|
392 |
return [result_str,result_file_path,total_info]
|