o
    
۾i                     @   s$   d dl Z G dd de jdddZdS )    Nc                   @   s   e Zd ZU dZeed< eed< dZeed< ej	ddZ
edB ed< dZedB ed	< d
Zeed< dd Zedd Zedd Ze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.

    lora_int_id must be globally unique for a given adapter.
    This is currently not enforced in vLLM.

    load_inplace: If True, forces reloading the adapter even if one
        with the same lora_int_id already exists in the cache. This replaces
        the existing adapter in-place. If False (default), only loads if the
        adapter is not already loaded.
    	lora_namelora_int_id 	lora_pathN)defaultbase_model_nametensorizer_config_dictFload_inplacec                 C   s,   | j dk rtd| j  | jsJ dd S )N   zid must be > 0, got zlora_path cannot be empty)r   
ValueErrorr   self r   E/home/ubuntu/.local/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_id'      zLoRARequest.adapter_idc                 C   r   r   )r   r   r   r   r   name+   r   zLoRARequest.namec                 C   r   r   )r   r   r   r   r   path/   r   zLoRARequest.pathvalue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   r   __eq__3   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__str__annotations__intr   msgspecfieldr   r	   dictr
   boolr   propertyr   r   r   objectr   r   r   r   r   r   r      s"   
 


r   T)omit_defaults
array_like)r&   Structr   r   r   r   r   <module>   s   

