Tijs Zwinkels
commited on
Commit
·
006de3e
1
Parent(s):
8896389
Fix imports
Browse filesNow, the ASR implementations do their own imports. No need to import in the factory
- whisper_online.py +1 -2
whisper_online.py
CHANGED
|
@@ -58,6 +58,7 @@ class WhisperTimestampedASR(ASRBase):
|
|
| 58 |
|
| 59 |
def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
|
| 60 |
import whisper
|
|
|
|
| 61 |
from whisper_timestamped import transcribe_timestamped
|
| 62 |
self.transcribe_timestamped = transcribe_timestamped
|
| 63 |
if model_dir is not None:
|
|
@@ -558,10 +559,8 @@ def asr_factory(args, logfile=sys.stderr):
|
|
| 558 |
asr = OpenaiApiASR(lan=args.lan)
|
| 559 |
else:
|
| 560 |
if backend == "faster-whisper":
|
| 561 |
-
from faster_whisper import FasterWhisperASR
|
| 562 |
asr_cls = FasterWhisperASR
|
| 563 |
else:
|
| 564 |
-
from whisper_timestamped import WhisperTimestampedASR
|
| 565 |
asr_cls = WhisperTimestampedASR
|
| 566 |
|
| 567 |
# Only for FasterWhisperASR and WhisperTimestampedASR
|
|
|
|
| 58 |
|
| 59 |
def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
|
| 60 |
import whisper
|
| 61 |
+
import whisper_timestamped
|
| 62 |
from whisper_timestamped import transcribe_timestamped
|
| 63 |
self.transcribe_timestamped = transcribe_timestamped
|
| 64 |
if model_dir is not None:
|
|
|
|
| 559 |
asr = OpenaiApiASR(lan=args.lan)
|
| 560 |
else:
|
| 561 |
if backend == "faster-whisper":
|
|
|
|
| 562 |
asr_cls = FasterWhisperASR
|
| 563 |
else:
|
|
|
|
| 564 |
asr_cls = WhisperTimestampedASR
|
| 565 |
|
| 566 |
# Only for FasterWhisperASR and WhisperTimestampedASR
|