diff --git a/modules/translation/translation_base.py b/modules/translation/translation_base.py index 3d22aa0..6087767 100644 --- a/modules/translation/translation_base.py +++ b/modules/translation/translation_base.py @@ -123,7 +123,8 @@ def translate_file(self, return [gr_str, output_file_paths] except Exception as e: - print(f"Error: {str(e)}") + print(f"Error translating file: {e}") + raise finally: self.release_cuda_memory() diff --git a/modules/whisper/base_transcription_pipeline.py b/modules/whisper/base_transcription_pipeline.py index 0bb233b..bf3b445 100644 --- a/modules/whisper/base_transcription_pipeline.py +++ b/modules/whisper/base_transcription_pipeline.py @@ -254,6 +254,7 @@ def transcribe_file(self, except Exception as e: print(f"Error transcribing file: {e}") + raise finally: self.release_cuda_memory() @@ -315,7 +316,8 @@ def transcribe_mic(self, result_str = f"Done in {self.format_time(time_for_task)}! Subtitle file is in the outputs folder.\n\n{subtitle}" return [result_str, file_path] except Exception as e: - print(f"Error transcribing file: {e}") + print(f"Error transcribing mic: {e}") + raise finally: self.release_cuda_memory() @@ -386,7 +388,8 @@ def transcribe_youtube(self, return [result_str, file_path] except Exception as e: - print(f"Error transcribing file: {e}") + print(f"Error transcribing youtube: {e}") + raise finally: self.release_cuda_memory()