Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -248,16 +248,21 @@ class WhisperBase(ABC):
|
|
| 248 |
*whisper_params,
|
| 249 |
)
|
| 250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 252 |
-
subtitle
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
add_timestamp=add_timestamp,
|
| 256 |
-
file_format=file_format,
|
| 257 |
-
output_dir=self.output_dir
|
| 258 |
-
)
|
| 259 |
-
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext)}
|
| 260 |
-
|
| 261 |
## Add output file as txt
|
| 262 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 263 |
subtitle, file_path = self.generate_and_write_file(
|
|
|
|
| 248 |
*whisper_params,
|
| 249 |
)
|
| 250 |
|
| 251 |
+
#file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 252 |
+
#subtitle, file_path = self.generate_and_write_file(
|
| 253 |
+
# file_name=file_name,
|
| 254 |
+
# transcribed_segments=transcribed_segments,
|
| 255 |
+
# add_timestamp=add_timestamp,
|
| 256 |
+
# file_format=file_format,
|
| 257 |
+
# output_dir=self.output_dir
|
| 258 |
+
#)
|
| 259 |
+
#files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext)}
|
| 260 |
+
|
| 261 |
+
## Get preview as txt
|
| 262 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 263 |
+
subtitle = get_txt(transcribed_segments)
|
| 264 |
+
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext)}
|
| 265 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
## Add output file as txt
|
| 267 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
| 268 |
subtitle, file_path = self.generate_and_write_file(
|