Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -260,7 +260,7 @@ class WhisperBase(ABC):
|
|
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,7 +271,7 @@ class WhisperBase(ABC):
|
|
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 = ''
|
@@ -283,9 +283,9 @@ class WhisperBase(ABC):
|
|
283 |
|
284 |
total_info += f"\nTranscription duration: {self.format_time(total_time)}"
|
285 |
result_str = total_result
|
286 |
-
result_file_path = [
|
287 |
|
288 |
-
return
|
289 |
|
290 |
except Exception as e:
|
291 |
print(f"Error transcribing file: {e}")
|
|
|
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 = ''
|
|
|
283 |
|
284 |
total_info += f"\nTranscription duration: {self.format_time(total_time)}"
|
285 |
result_str = total_result
|
286 |
+
result_file_path = [info['path'] for info in files_to_download.values()]
|
287 |
|
288 |
+
return result_str, result_file_path, total_info
|
289 |
|
290 |
except Exception as e:
|
291 |
print(f"Error transcribing file: {e}")
|