o
    iX
                     @   sB   d Z ddlmZmZ G dd deddZG dd deZdgZd	S )
z
Processor class for TVP.
   )ProcessingKwargsProcessorMixinc                   @   s   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 r   r   c/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/transformers/models/tvp/processing_tvp.pyr      s    r   F)totalc                       s:   e Zd ZdZddgZdZdZd fdd	Zd	d
 Z  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                    s   t  || || _d S )N)super__init__video_processor)selfr   r   kwargs	__class__r   r   r   3   s   
zTvpProcessor.__init__c                 C   s>   t | d d | dt | d d | 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endr   r   r   post_process_video_grounding7   s   z)TvpProcessor.post_process_video_grounding)NN)
r   r   r   __doc__
attributesimage_processor_classtokenizer_classr   r'   __classcell__r   r   r   r   r   !   s    r   N)r(   processing_utilsr   r   r   r   __all__r   r   r   r   <module>   s
   
.