+
    TV-j½  ã                   ó(  € ^ RI Ht ^ RIHtHtHt ^ RIHt ^ RI	H
t
 ^ RIt^ RIHtHtHt Rt/ RRbRRbRR	bR
R
bRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbtR R lt]],          ]R]P*                  3R R lltR!R R lltR!R R  lltR# )"é    )ÚPath)ÚAnyÚOptionalÚUnionN)Úbase_load_modelÚget_model_pathÚload_configi€>  Ú
cohere_asrÚfireredasr2ÚglmÚglmasrÚ
sensevoiceÚvoxtralÚvoxtral_realtimeÚ	vibevoiceÚvibevoice_asrÚ	qwen3_asrÚfun_asr_nanoÚcanaryÚ	moonshineÚmmsÚgranite_speechÚgranite_speech_narÚqwen2_audioÚmega_asrc                óp   € V ^8„  d   QhR\         P                  R\        R\        R\         P                  /# )é   ÚaudioÚorig_srÚ	target_srÚreturn)ÚnpÚndarrayÚint)Úformats   "Úd/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/mlx_audio/stt/utils.pyÚ__annotate__r'       s0   € ÷ >ñ >œ"Ÿ*™*ð >¬sð >¼sð >ÄrÇzÁzñ >ó    c                 ó$   € ^ RI Hp V! WV^ R7      # )r   )Úresample_audio©Úaxis)Úmlx_audio.utilsr*   )r   r   r    Ú_resample_audios   &&& r&   r*   r*       s   € ÝAá˜5¨9¸1Ô=Ð=r(   Fc                óP   € V ^8„  d   QhR\         R\        R\        P                  /# )r   ÚfileÚsrÚdtype)Ústrr$   ÚmxÚDtype)r%   s   "r&   r'   r'   &   s*   € ÷ 5ñ 5Ü
ð5äð5ô �8‰8ñ	5r(   c                ó˜   € ^ RI Hp V! V RR7      w  rVWa8w  d   \        WVV4      p\        P                  ! WSR7      P                  ^R7      # )a  
Open an audio file and read as mono waveform, resampling as necessary

Parameters
----------
file: str
    The audio file to open

sr: int
    The sample rate to resample the audio if necessary

Returns
-------
A NumPy array containing the audio waveform, in float32 dtype.
)ÚreadT)Ú	always_2d)r2   r+   )Úmlx_audio.audio_ior7   r*   r4   ÚarrayÚmean)r0   r1   Ú
from_stdinr2   Ú
audio_readr   Úsample_rates   &&&&   r&   Ú
load_audior?   &   sE   € õ* 6á# D°DÔ9Ñ€EØÔÜ˜u°2Ó6ˆÜ�8Š8�EÔ'×,Ñ,°!Ð,Ó4Ð4r(   c          
      óŠ   € V ^8„  d   QhR\         \        \        3,          R\        R\        R\        R\
        P                  /# ©r   Ú
model_pathÚlazyÚstrictÚkwargsr!   ©r   r3   r   Úboolr   ÚnnÚModule)r%   s   "r&   r'   r'   C   sG   € ÷ ñ Ü”cœ4�iÕ ðä
ðô ðô ð	ô
 ‡Y�Yñr(   c                ó4   € \        RRV RRR\        RVRV/VB # )a~  
Load and initialize an STT model from a given path.

Args:
    model_path: The path or HuggingFace repo to load the model from.
    lazy: If False, evaluate model parameters immediately.
    strict: If True, raise an error if any weights are missing.
    **kwargs: Additional keyword arguments (revision, force_download).

Returns:
    nn.Module: The loaded and initialized model.
rB   ÚcategoryÚsttÚmodel_remappingrC   rD   © )r   ÚMODEL_REMAPPING©rB   rC   rD   rE   s   &&&,r&   Ú
load_modelrQ   C   sI   € ô$ ñ Øðàðô (ðð ð	ð
 ðð ñð r(   c          
      óŠ   € V ^8„  d   QhR\         \        \        3,          R\        R\        R\        R\
        P                  /# rA   rF   )r%   s   "r&   r'   r'   _   sN   € ÷ Fñ FÜ”cœ4�iÕ ðFä
ðFô ðFô ð	Fô
 ‡Y�YñFr(   c                ó"   € \        V 3RVRV/VB # )a3  
Load a speech-to-text model from a local path or HuggingFace repository.

This is the main entry point for loading STT models. It automatically
detects the model type and initializes the appropriate model class.

Args:
    model_path: The local path or HuggingFace repo ID to load from.
    lazy: If False, evaluate model parameters immediately.
    strict: If True, raise an error if any weights are missing.
    **kwargs: Additional keyword arguments such as `revision` and
        `force_download`.

Returns:
    nn.Module: The loaded and initialized model.

rC   rD   )rQ   rP   s   &&&,r&   ÚloadrT   _   s   € ô. �jÑE tÐE°FÐE¸fÑEÐEr(   )FF)Úpathlibr   Útypingr   r   r   Úmlx.coreÚcorer4   Úmlx.nnrH   Únumpyr"   r-   r   r   r	   ÚSAMPLE_RATErO   r*   r3   Úfloat32r?   rQ   rT   rN   r(   r&   Ú<module>r]      s  ðÝ ß 'Ñ 'å Ý Û ç HÑ Hà€ðØ�,ðà�=ðð 
ˆ8ðð �,ð	ð
 ˆyðð Ð*ðð �ðð �ðð �Nðð ˆhðð �ðð 
ˆ5ðð Ð&ðð Ð.ðð �=ðð  �
ð!€õ(>ð ˜•ØØØ—j‘j÷	5÷:÷8Fñ Fr(   