import WhisperModel
This commit is contained in:
parent
a1ba5e6c3a
commit
33369a9555
1 changed files with 3 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ from functools import lru_cache
|
||||||
import time
|
import time
|
||||||
from mosestokenizer import MosesTokenizer
|
from mosestokenizer import MosesTokenizer
|
||||||
|
|
||||||
|
|
||||||
@lru_cache
|
@lru_cache
|
||||||
def load_audio(fname):
|
def load_audio(fname):
|
||||||
a, _ = librosa.load(fname, sr=16000)
|
a, _ = librosa.load(fname, sr=16000)
|
||||||
|
|
@ -89,6 +90,8 @@ class FasterWhisperASR(ASRBase):
|
||||||
sep = ""
|
sep = ""
|
||||||
|
|
||||||
def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
|
def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
|
||||||
|
from faster_whisper import WhisperModel
|
||||||
|
|
||||||
|
|
||||||
if model_dir is not None:
|
if model_dir is not None:
|
||||||
print(f"Loading whisper model from model_dir {model_dir}. modelsize and cache_dir parameters are not used.",file=sys.stderr)
|
print(f"Loading whisper model from model_dir {model_dir}. modelsize and cache_dir parameters are not used.",file=sys.stderr)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue