File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
stable_whisper/whisper_word_level Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 44from functools import lru_cache
55
66import numpy as np
7- import mlx .core as mx
87
98from ..audio import convert_demucs_kwargs , prep_audio
109from ..non_whisper import transcribe_any
@@ -62,8 +61,6 @@ def load_mlx_model(model_name: str, dtype=None):
6261 from mlx_whisper import load_models
6362
6463 model_id = MLX_MODELS .get (model_name , model_name )
65- if dtype is None :
66- dtype = mx .float32
6764
6865 return load_models .load_model (model_id , dtype = dtype )
6966
@@ -186,6 +183,7 @@ def _inner_transcribe(
186183 print (f'Transcribing with MLX Whisper ({ model_path } )...' )
187184
188185 if isinstance (audio , np .ndarray ):
186+ import mlx .core as mx
189187 audio_mx = mx .array (audio )
190188 else :
191189 audio_mx = audio
@@ -316,6 +314,7 @@ def transcribe(
316314
317315
318316def load_mlx_whisper (model_name : str , dtype = None , ** model_kwargs ):
317+ import mlx .core as mx
319318 if dtype is None :
320319 dtype = mx .float32
321320
You can’t perform that action at this time.
0 commit comments