
     `iX
                     \    d Z ddlmZmZ  G d ded          Z G d de          ZdgZd	S )
z
Processor class for TVP.
   )ProcessingKwargsProcessorMixinc                        e Zd ZddddddiZdS )TvpProcessorKwargstext_kwargsT
max_lengthF)
truncationpaddingpad_to_max_lengthreturn_token_type_idsN)__name__
__module____qualname__	_defaults     z/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/transformers/models/tvp/processing_tvp.pyr   r      s.        #!%%*	
 
IIIr   r   F)totalc                   :     e Zd ZdZddgZdZdZd	 fd	Zd Z xZ	S )
TvpProcessora  
    Constructs an TVP processor which wraps a TVP image processor and a Bert tokenizer into a single processor.

    [`TvpProcessor`] offers all the functionalities of [`TvpImageProcessor`] and [`BertTokenizerFast`]. See the
    [`~TvpProcessor.__call__`] and [`~TvpProcessor.decode`] for more information.

    Args:
        image_processor ([`TvpImageProcessor`], *optional*):
            The image processor is a required input.
        tokenizer ([`BertTokenizerFast`], *optional*):
            The tokenizer is a required input.
    image_processor	tokenizerTvpImageProcessor)BertTokenizerBertTokenizerFastNc                 Z    t                                          ||           || _        d S )N)super__init__video_processor)selfr   r   kwargs	__class__s       r   r   zTvpProcessor.__init__3   s+    )444.r   c                     t          |                                d         d         |z  d          t          |                                d         d         |z  d          }}||fS )a  
        Compute the time of the video.

        Args:
            logits (`torch.Tensor`):
                The logits output of TvpForVideoGrounding.
            video_durations (`float`):
                The video's duration.

        Returns:
            start (`float`):
                The start time of the video.
            end (`float`):
                The end time of the video.
               )roundtolist)r    logitsvideo_durationsstartends        r   post_process_video_groundingz)TvpProcessor.post_process_video_grounding7   s_    " &--//!$Q'/91==&--//!$Q'/91== 
 czr   )NN)
r   r   r   __doc__
attributesimage_processor_classtokenizer_classr   r,   __classcell__)r"   s   @r   r   r   !   sm          $[1J/<O/ / / / / /      r   r   N)r-   processing_utilsr   r   r   r   __all__r   r   r   <module>r4      s     A @ @ @ @ @ @ @    )    + + + + +> + + +\ 
r   