o
    )ij                     @   sD   d dl Z d dlmZ d dlZd dlmZ G dd dejdddZdS )    N)Optional)AdapterRequestc                   @   s   e Zd ZU dZeZeed< eed< dZ	eed< e
jddZee ed< dZee ed	< e
jddZee ed
< dZee ed< dd Zedd Zedd Zedd Zedd Zejdd ZdedefddZdefddZdS )LoRARequesta  
    Request for a LoRA adapter.

    Note that this class should be used internally. For online
    serving, it is recommended to not allow users to use this class but
    instead provide another layer of abstraction to prevent users from
    accessing unauthorized LoRA adapters.

    lora_int_id must be globally unique for a given adapter.
    This is currently not enforced in vLLM.
    	lora_namelora_int_id 	lora_pathN)defaultlora_local_pathlong_lora_max_lenbase_model_nametensorizer_config_dictc                 C   s:   | j rtjdtdd | js| j pd| _| jsJ dd S )NzvThe 'lora_local_path' attribute is deprecated and will be removed in a future version. Please use 'lora_path' instead.   
stacklevelr   zlora_path cannot be empty)r
   warningswarnDeprecationWarningr   self r   ]/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/vllm/lora/request.py__post_init__%   s   zLoRARequest.__post_init__c                 C      | j S N)r   r   r   r   r   
adapter_id3      zLoRARequest.adapter_idc                 C   r   r   )r   r   r   r   r   name7   r   zLoRARequest.namec                 C   r   r   )r   r   r   r   r   path;   r   zLoRARequest.pathc                 C   s   t jdtdd | jS NzlThe 'local_path' attribute is deprecated and will be removed in a future version. Please use 'path' instead.r   r   r   r   r   r   r   r   r   r   
local_path?   s   zLoRARequest.local_pathc                 C   s   t jdtdd || _d S r   r    r   valuer   r   r   r!   I   s   
r#   returnc                 C   s   t || jo| j|jkS )z
        Overrides the equality method to compare LoRARequest
        instances based on lora_name. This allows for identification
        and comparison lora adapter across engines.
        )
isinstance	__class__r   r"   r   r   r   __eq__S   s
   
zLoRARequest.__eq__c                 C   s
   t | jS )a  
        Overrides the hash method to hash LoRARequest instances
        based on lora_name. This ensures that LoRARequest instances
        can be used in hash-based collections such as sets and dictionaries,
        identified by their names across engines.
        )hashr   r   r   r   r   __hash__\   s   
zLoRARequest.__hash__)__name__
__module____qualname____doc__r   __metaclass__str__annotations__intr   msgspecfieldr
   r   r   r   r   dictr   propertyr   r   r   r!   setterobjectboolr'   r)   r   r   r   r   r      s.   
 



	
		r   T)Zomit_defaultsZ
array_like)r   typingr   r2   Zvllm.adapter_commons.requestr   Structr   r   r   r   r   <module>   s   

