o
    ॵi
                     @   sf  d dl Z d dlmZmZmZmZmZmZ d dl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 d dlmZmZ d d	lmZmZmZ d d
lmZ e 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ListSequenceTupleUnion)	Pipelines)Model)
OutputKeys)Pipeline)	PIPELINES)generate_scp_from_urlupdate_local_model)
Frameworks	ModelFileTasks)
get_loggerFunASRPipeline)module_namec                       sF   e Zd ZdZd	deeef f fddZdeee	f fddZ
  ZS )
r   a  Voice Activity Detection Inference Pipeline
    use `model` to create a Voice Activity Detection pipeline.

    Args:
        model: A model instance, or a model local dir, or a model id in the model hub.
        kwargs (dict, `optional`):
            Extra kwargs passed into the preprocessor's constructor.

    Example:
        >>> from modelscope.pipelines import pipeline
        >>> p = pipeline(
        >>>    task=Tasks.voice_activity_detection, model='damo/speech_fsmn_vad_zh-cn-16k-common-pytorch')
        >>> audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/vad_example.pcm'
        >>> print(p(audio_in))

    Nmodelc                    s   t  jdd|i| dS )z=use `model` to create an vad pipeline for prediction
        r   N )super__init__)selfr   kwargs	__class__r   ^/home/ubuntu/.local/lib/python3.10/site-packages/modelscope/pipelines/audio/funasr_pipeline.pyr   ;   s   zFunASRPipeline.__init__returnc                 O   s   | j |i |}|S )z
        Decoding the input audios
        Args:
            input('str' or 'bytes'):
        Return:
            a list of dictionary of result.
        )r   )r   argsr   outputr   r   r   __call__@   s   	zFunASRPipeline.__call__)N)__name__
__module____qualname____doc__r   r	   strr   r   r   r!   __classcell__r   r   r   r   r      s    )+ostypingr   r   r   r   r   r   jsonyamlmodelscope.metainfor   modelscope.modelsr	   modelscope.outputsr
   modelscope.pipelines.baser   modelscope.pipelines.builderr   "modelscope.utils.audio.audio_utilsr   r   modelscope.utils.constantr   r   r   modelscope.utils.loggerr   logger__all__register_moduleauto_speech_recognitionfunasr_pipelinevoice_activity_detectionlanguage_score_predictionpunctuationspeaker_diarizationspeaker_verificationspeech_separationspeech_timestampemotion_recognitionr   r   r   r   r   <module>   sT    &