Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -249,7 +249,7 @@ class WhisperBase(ABC):
|
|
249 |
file_format=file_format,
|
250 |
output_dir=self.output_dir
|
251 |
)
|
252 |
-
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "
|
253 |
|
254 |
## Add output file as txt
|
255 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
@@ -279,13 +279,12 @@ class WhisperBase(ABC):
|
|
279 |
for file_name, info in files_info.items():
|
280 |
total_result += f'{info["subtitle"]}'
|
281 |
total_time += info["time_for_task"]
|
282 |
-
|
283 |
-
total_info += f"Input file: {info['input']}\nLanguage prediction: {info['lang']}\n"
|
284 |
|
285 |
#result_str = f"Processing of file '{file_name}{file_ext}' done in {self.format_time(total_time)}:\n\n{total_result}"
|
286 |
total_info += f"\nTranscription duration: {self.format_time(total_time)}"
|
287 |
result_str = total_result
|
288 |
-
result_file_path = [info['path'] for info in
|
289 |
|
290 |
return [result_str, result_file_path, total_info]
|
291 |
|
|
|
249 |
file_format=file_format,
|
250 |
output_dir=self.output_dir
|
251 |
)
|
252 |
+
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "input_source_file": (file_name+file_ext)}
|
253 |
|
254 |
## Add output file as txt
|
255 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
|
|
279 |
for file_name, info in files_info.items():
|
280 |
total_result += f'{info["subtitle"]}'
|
281 |
total_time += info["time_for_task"]
|
282 |
+
total_info += f'Input file: {info["input_source_file"]}\nLanguage prediction: {info["lang"]}\n'
|
|
|
283 |
|
284 |
#result_str = f"Processing of file '{file_name}{file_ext}' done in {self.format_time(total_time)}:\n\n{total_result}"
|
285 |
total_info += f"\nTranscription duration: {self.format_time(total_time)}"
|
286 |
result_str = total_result
|
287 |
+
result_file_path = [info['path'] for info in files_to_download.values()]
|
288 |
|
289 |
return [result_str, result_file_path, total_info]
|
290 |
|