Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -249,7 +249,6 @@ class WhisperBase(ABC):
|
|
| 249 |
file_format=file_format,
|
| 250 |
output_dir=self.output_dir
|
| 251 |
)
|
| 252 |
-
|
| 253 |
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "input": (file_name+file_ext)}
|
| 254 |
|
| 255 |
## Add output file as txt
|
|
@@ -261,7 +260,7 @@ class WhisperBase(ABC):
|
|
| 261 |
file_format="txt",
|
| 262 |
output_dir=self.output_dir
|
| 263 |
)
|
| 264 |
-
files_to_download[file_name+"_txt"] = {"
|
| 265 |
|
| 266 |
## Add output file as srt
|
| 267 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
|
@@ -272,7 +271,7 @@ class WhisperBase(ABC):
|
|
| 272 |
file_format="srt",
|
| 273 |
output_dir=self.output_dir
|
| 274 |
)
|
| 275 |
-
files_to_download[file_name+"_srt"] = {"
|
| 276 |
|
| 277 |
total_result = ''
|
| 278 |
total_info = ''
|
|
@@ -281,7 +280,7 @@ class WhisperBase(ABC):
|
|
| 281 |
total_result += f'{info["subtitle"]}'
|
| 282 |
total_time += info["time_for_task"]
|
| 283 |
#total_info += f'{info["lang"]}'
|
| 284 |
-
total_info += f"Input file: {info['input']}\nLanguage prediction: {info['lang']}
|
| 285 |
|
| 286 |
#result_str = f"Processing of file '{file_name}{file_ext}' done in {self.format_time(total_time)}:\n\n{total_result}"
|
| 287 |
total_info += f"\nTranscription duration: {self.format_time(total_time)}"
|
|
|
|
| 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": (file_name+file_ext)}
|
| 253 |
|
| 254 |
## Add output file as txt
|
|
|
|
| 260 |
file_format="txt",
|
| 261 |
output_dir=self.output_dir
|
| 262 |
)
|
| 263 |
+
files_to_download[file_name+"_txt"] = {"path": file_path}
|
| 264 |
|
| 265 |
## Add output file as srt
|
| 266 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
|
|
|
| 271 |
file_format="srt",
|
| 272 |
output_dir=self.output_dir
|
| 273 |
)
|
| 274 |
+
files_to_download[file_name+"_srt"] = {"path": file_path}
|
| 275 |
|
| 276 |
total_result = ''
|
| 277 |
total_info = ''
|
|
|
|
| 280 |
total_result += f'{info["subtitle"]}'
|
| 281 |
total_time += info["time_for_task"]
|
| 282 |
#total_info += f'{info["lang"]}'
|
| 283 |
+
total_info += f"Input file: {info['input']}\nLanguage prediction: {info['lang']}"
|
| 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)}"
|