o
    ei                     @   sR   d Z ddlmZmZ ddlmZ G dd deddZeG dd	 d	eZd	gZd
S )z
Processor class for TVP.
   )ProcessingKwargsProcessorMixin)auto_docstringc                   @   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   d/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/transformers/models/tvp/processing_tvp.pyr      s    r   F)totalc                       s&   e Zd Zd fdd	Zdd Z  ZS )TvpProcessorNc                    s   t  || || _d S )N)super__init__video_processor)selfimage_processor	tokenizerkwargs	__class__r   r   r   #   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_grounding'   s   z)TvpProcessor.post_process_video_grounding)NN)r   r   r   r   r%   __classcell__r   r   r   r   r   !   s    r   N)	__doc__processing_utilsr   r   utilsr   r   r   __all__r   r   r   r   <module>   s   
