
    (HJj              	           d dl mZ d dlmZmZ d dlmZ d dlmZ dZ	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)OptionalUnionN)base_load_modeli>  
ecapa_tdnn)z
ecapa-tdnnr   
model_pathlazystrictreturnc           	      ,    t        d| dt        ||d|S )a  
    Load and initialize a LID 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.
    lid)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/lid/utils.py
load_modelr      s/      '      c                      t        | f||d|S )aS  
    Load a language identification model from a local path or HuggingFace repository.

    This is the main entry point for loading LID 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.lid import load
        >>> model = load("facebook/mms-lid-256")
        >>> results = model.predict(audio)
    )r	   r
   )r   r   s       r   loadr   )   s    2 jEtFEfEEr   )FF)pathlibr   typingr   r   mlx.nnnnmlx_audio.utilsr   SAMPLE_RATEr   strboolModuler   r   r   r   r   <module>r"      s     "  +  FKc4i (,>BYY4 FKFc4i F(,F>BFYYFr   