Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -240,6 +240,18 @@ class WhisperBase(ABC):
|
|
240 |
*whisper_params,
|
241 |
)
|
242 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
244 |
subtitle, file_path = self.generate_and_write_file(
|
245 |
file_name=file_name,
|
@@ -250,7 +262,19 @@ class WhisperBase(ABC):
|
|
250 |
)
|
251 |
|
252 |
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language}
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
total_result = ''
|
255 |
total_info = ''
|
256 |
total_time = 0
|
|
|
240 |
*whisper_params,
|
241 |
)
|
242 |
|
243 |
+
# file_name, file_ext = os.path.splitext(os.path.basename(file))
|
244 |
+
# subtitle, file_path = self.generate_and_write_file(
|
245 |
+
# file_name=file_name,
|
246 |
+
# transcribed_segments=transcribed_segments,
|
247 |
+
# add_timestamp=add_timestamp,
|
248 |
+
# file_format=file_format,
|
249 |
+
# output_dir=self.output_dir
|
250 |
+
# )
|
251 |
+
#
|
252 |
+
# files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language}
|
253 |
+
|
254 |
+
## Add 1st file as txt
|
255 |
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
256 |
subtitle, file_path = self.generate_and_write_file(
|
257 |
file_name=file_name,
|
|
|
262 |
)
|
263 |
|
264 |
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language}
|
265 |
+
|
266 |
+
## Add 2nd file as srt
|
267 |
+
file_name, file_ext = os.path.splitext(os.path.basename(file))
|
268 |
+
subtitle, file_path = self.generate_and_write_file(
|
269 |
+
file_name=file_name,
|
270 |
+
transcribed_segments=transcribed_segments,
|
271 |
+
add_timestamp=add_timestamp,
|
272 |
+
file_format="srt",
|
273 |
+
output_dir=self.output_dir
|
274 |
+
)
|
275 |
+
|
276 |
+
files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language}
|
277 |
+
|
278 |
total_result = ''
|
279 |
total_info = ''
|
280 |
total_time = 0
|