o
    ߥi	                     @   s  d dl Z d dlmZmZ d dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZmZ dgZejejejd	ejejejd	ejejejd	ejejejd	ejejejd	ejejejd	ejejejd	ejejejd	ejejejd	G d
d de
ZdS )    N)AnyDict)	AutoModel)Models)Model)MODELS)
FrameworksTasksGenericFunASR)module_namec                       s$   e Zd Z fddZdd Z  ZS )r
   c                    s   t  j|g|R i | tttj|d }d|vr1d|v r1|d |d< |	dd|d< d|vrGd|v rG|d |d< |	dd|d< d|vr]d|v r]|d |d< |	dd|d< t
d
d	|i|| _dS )a  initialize the info of model.

        Args:
            model_dir (str): the model path.
            am_model_name (str): the am model name from configuration.json
            model_config (Dict[str, Any]): the detail config about model from configuration.json
        zconfiguration.json	vad_modelvad_model_revisionN
punc_modelpunc_model_revision	spk_modelspk_model_revisionmodel )super__init__jsonloadsopenospathjoinreadgetr   r   )self	model_dirargskwargs	model_cfg	__class__r   X/home/ubuntu/.local/lib/python3.10/site-packages/modelscope/models/audio/funasr/model.pyr      s(   zGenericFunASR.__init__c                 O   s   | j j|i |}|S )z7preload model and return the info of the model
        )r   generate)r   r    r!   outputr   r   r%   forward9   s   zGenericFunASR.forward)__name__
__module____qualname__r   r(   __classcell__r   r   r#   r%   r
      s    )r   typingr   r   r   funasrr   modelscope.metainfor   modelscope.models.baser   modelscope.models.builderr   modelscope.utils.constantr   r	   __all__register_moduleauto_speech_recognitionvoice_activity_detectionlanguage_score_predictionpunctuationspeaker_diarizationspeaker_verificationspeech_separationspeech_timestampemotion_recognitionr
   r   r   r   r%   <module>   s2   &