
    Z j                     ^    S r SSKJrJr  SSKJr   " S S\SS9r\ " S S	\5      5       rS	/rg
)z
Processor class for TVP.
   )ProcessingKwargsProcessorMixin)auto_docstringc                   &    \ rS rSrSSSSSS.0rSrg)	TvpProcessorKwargs   text_kwargsT
max_lengthF)
truncationpaddingpad_to_max_lengthreturn_token_type_ids N)__name__
__module____qualname____firstlineno__	_defaults__static_attributes__r       w/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/tvp/processing_tvp.pyr   r      s    #!%%*	
Ir   r   F)totalc                   2   ^  \ rS rSrSU 4S jjrS rSrU =r$ )TvpProcessor!   c                 0   > [         TU ]  X5        Xl        g )N)super__init__video_processor)selfimage_processor	tokenizerkwargs	__class__s       r   r   TvpProcessor.__init__#   s    4.r   c                     [        UR                  5       S   S   U-  S5      [        UR                  5       S   S   U-  S5      pCX44$ )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_grounding)TvpProcessor.post_process_video_grounding'   sQ    " &--/!$Q'/91=&--/!$Q'/91= 
 zr   )r   )NN)r   r   r   r   r   r/   r   __classcell__)r$   s   @r   r   r   !   s    / r   r   N)	__doc__processing_utilsr   r   utilsr   r   r   __all__r   r   r   <module>r6      sG    A #)  >  : 
r   