

Fix imports
Now, the ASR implementations do their own imports. No need to import in the factory
@1610c10f7b1f1d0cdf9d9eb17d88c133fe7a18c3
--- whisper_online.py
+++ whisper_online.py
... | ... | @@ -58,6 +58,7 @@ |
58 | 58 |
|
59 | 59 |
def load_model(self, modelsize=None, cache_dir=None, model_dir=None): |
60 | 60 |
import whisper |
61 |
+ import whisper_timestamped |
|
61 | 62 |
from whisper_timestamped import transcribe_timestamped |
62 | 63 |
self.transcribe_timestamped = transcribe_timestamped |
63 | 64 |
if model_dir is not None: |
... | ... | @@ -558,10 +559,8 @@ |
558 | 559 |
asr = OpenaiApiASR(lan=args.lan) |
559 | 560 |
else: |
560 | 561 |
if backend == "faster-whisper": |
561 |
- from faster_whisper import FasterWhisperASR |
|
562 | 562 |
asr_cls = FasterWhisperASR |
563 | 563 |
else: |
564 |
- from whisper_timestamped import WhisperTimestampedASR |
|
565 | 564 |
asr_cls = WhisperTimestampedASR |
566 | 565 |
|
567 | 566 |
# Only for FasterWhisperASR and WhisperTimestampedASR |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?