o
    )i                     @   sT   d dl m Z  d dlmZmZ d dlmZ dedefddZdededefd	d
ZdS )    )array)AnyType)VLLM_TOKEN_ID_ARRAY_TYPEobjreturnc                 C   s8   t | tr| jtksJ dt d| j d|  S dS )zCustom msgspec enc hook that supports array types.

    See https://jcristharif.com/msgspec/api.html#msgspec.msgpack.Encoder
    zvLLM array type should use 'z'' type. Given array has a type code of .N)
isinstancer   typecoder   tobytes)r    r   g/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/vllm/executor/msgspec_utils.pyencode_hook
   s   
r   typec                 C   s"   | t u rt t}|| |S dS )zCustom msgspec dec hook that supports array types.

    See https://jcristharif.com/msgspec/api.html#msgspec.msgpack.Encoder
    N)r   r   	frombytes)r   r   Zdeserializedr   r   r   decode_hook   s
   
r   N)r   typingr   r   Zvllm.sequencer   r   r   r   r   r   r   <module>   s
   