
    hX
                     N    d Z ddlmZmZ  G d ded      Z G d de      ZdgZy	)
z
Processor class for TVP.
   )ProcessingKwargsProcessorMixinc                       e Zd ZddddddiZy)TvpProcessorKwargstext_kwargsT
max_lengthF)
truncationpaddingpad_to_max_lengthreturn_token_type_idsN)__name__
__module____qualname__	_defaults     e/var/www/html/aiagenthome/venv/lib/python3.12/site-packages/transformers/models/tvp/processing_tvp.pyr   r      s    #!%%*	
Ir   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BertTokenizerFastc                 4    t         |   ||       || _        y )N)super__init__video_processor)selfr   r   kwargs	__class__s       r   r   zTvpProcessor.__init__3   s    )4.r   c                     t        |j                         d   d   |z  d      t        |j                         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   sU    " &--/!$Q'/91=&--/!$Q'/91= 
 czr   )NN)
r   r   r   __doc__
attributesimage_processor_classtokenizer_classr   r,   __classcell__)r"   s   @r   r   r   !   s)     $[1J/<O/r   r   N)r-   processing_utilsr   r   r   r   __all__r   r   r   <module>r4      s6    A) +> +\ 
r   