o
    پi!                     @   s@   d dl mZmZ d dlmZ d dlmZmZ G dd deZdS )    )ListUnion)	CLIPModel)BaseMultimodalProcessorMultimodalSpecialTokensc                       s<   e Zd ZegZ fddZdeeee	f  fddZ
  ZS )ClipImageProcessorc                    s4   t  j|||g|R i | tdd|| _d S )Nz<image>)image_token)super__init__r   build	mm_tokens)self	hf_configserver_args
_processorargskwargs	__class__ Y/home/ubuntu/.local/lib/python3.10/site-packages/sglang/srt/multimodal/processors/clip.pyr
      s   

zClipImageProcessor.__init__
image_datac           	         s6   | j || j|d}| || j\}}}| |dS )N)promptmultimodal_tokensr   )	input_idsmm_items)load_mm_datar   process_and_combine_mm_datatolist)	r   r   
input_textr   r   base_outputr   r   _r   r   r   process_mm_data_async   s   
z(ClipImageProcessor.process_mm_data_async)__name__
__module____qualname__r   modelsr
   r   r   strbytesr"   __classcell__r   r   r   r   r   
   s    r   N)	typingr   r   sglang.srt.models.clipr   /sglang.srt.multimodal.processors.base_processorr   r   r   r   r   r   r   <module>   s    