Dominik Macháček 2024-03-21
Merge pull request #70 from tijszwinkels/fix-imports
Fix imports
@3aee2fb709abf514ae5c6e02213fda8a86cb46e5
whisper_online.py
--- whisper_online.py
+++ whisper_online.py
@@ -58,6 +58,7 @@
 
     def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
         import whisper
+        import whisper_timestamped
         from whisper_timestamped import transcribe_timestamped
         self.transcribe_timestamped = transcribe_timestamped
         if model_dir is not None:
@@ -558,10 +559,8 @@
         asr = OpenaiApiASR(lan=args.lan)
     else:
         if backend == "faster-whisper":
-            from faster_whisper import FasterWhisperASR
             asr_cls = FasterWhisperASR
         else:
-            from whisper_timestamped import WhisperTimestampedASR
             asr_cls = WhisperTimestampedASR
 
         # Only for FasterWhisperASR and WhisperTimestampedASR
Add a comment
List