
    (HJj              	           d dl mZ d dlmZ d dlmZ d dlmZ ddddZ	 ddee	ef   d	e
d
e
dej                  fdZ	 ddee	ef   d	e
d
e
dej                  fdZy)    )Path)UnionN)base_load_model
silero_vadfsmn)sileroz
silero-vadr   
model_pathlazystrictreturnc           	      ,    t        d| dt        ||d|S )a  
    Load and initialize a VAD/diarization 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.
    vad)r	   categorymodel_remappingr
   r    )r   MODEL_REMAPPINGr	   r
   r   kwargss       ]/Users/ahmed/devFolder/claude-voice/.venv/lib/python3.12/site-packages/mlx_audio/vad/utils.py
load_modelr      s/      '      c                      t        | f||d|S )a  
    Load a VAD/diarization model from a local path or HuggingFace repository.

    This is the main entry point for loading VAD 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:
            - revision (str): HuggingFace revision/branch to use
            - force_download (bool): Force re-download of model files

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

    Example:
        >>> from mlx_audio.vad import load
        >>> model = load("mlx-community/diar_streaming_sortformer_4spk-v2.1-fp16")
        >>> result = model.generate("audio.wav", verbose=True)
    )r
   r   )r   r   s       r   loadr   $   s    2 jEtFEfEEr   )FF)pathlibr   typingr   mlx.nnnnmlx_audio.utilsr   r   strboolModuler   r   r   r   r   <module>r"      s       +)vV FKc4i (,>BYY4 FKFc4i F(,F>BFYYFr   