
    oiH                         S SK r S SKJrJr  S SKrS SKr S SKJr   " S S\R                  SSS9rg! \	 a    Sr N f = f)    N)OptionalDict)AdapterRequestc                      \ rS rSr% Sr\b  \r\\S'   \	\S'   Sr
\\S'   Sr\\\\R                  4      \S'   S	r\\   \S
'   \R$                  " SS9r\\   \S'   Sr\\	   \S'   \R$                  " SS9r\\   \S'   Sr\\\\R                  4      \S'   \S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\R>                  S 5       rS\ S\!4S jr"S\	4S jr#Sr$g)LoRARequest   ah  
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.
N	lora_namelora_int_id 	lora_pathlora_tensorsNlora_config)defaultlora_local_pathlong_lora_max_lenbase_model_namelora_embeddingsc                     U R                   $ r   )r
   selfs    W/home/james-whalen/.local/lib/python3.13/site-packages/unsloth_zoo/vllm_lora_request.py
adapter_idLoRARequest.adapter_id+           c                     U R                   $ r   )r	   r   s    r   nameLoRARequest.name/       ~~r   c                     U R                   $ r   r   r   s    r   pathLoRARequest.path3   r    r   c                     U R                   $ r   )r   r   s    r   tensorsLoRARequest.tensors7   s       r   c                     U R                   $ r   )r   r   s    r   configLoRARequest.config;   r   r   c                     U R                   $ r   )r   r   s    r   
embeddingsLoRARequest.embeddings?   s    ###r   c                 N    [         R                  " S[        SS9  U R                  $ NzlThe 'local_path' attribute is deprecated and will be removed in a future version. Please use 'path' instead.   )
stacklevelwarningswarnDeprecationWarningr   r   s    r   
local_pathLoRARequest.local_pathC   s'    ) 	 ~~r   c                 D    [         R                  " S[        SS9  Xl        g r/   r2   r   values     r   r6   r7   M   s"    ) 	 r   r:   returnc                 n    [        UU R                  5      =(       a    U R                  UR                  :H  $ )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	   r9   s     r   __eq__LoRARequest.__eq__W   s1     %..* P.2nn.O	Pr   c                 ,    [        U R                  5      $ )z
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   s    r   __hash__LoRARequest.__hash__`   s     DNN##r   r"   )%__name__
__module____qualname____firstlineno____doc__adapter_request__metaclass__str__annotations__intr   r   r   r   torchTensorr   msgspecfieldr   r   r   r   propertyr   r   r#   r&   r)   r,   r6   setterobjectboolr?   rC   __static_attributes__ r   r   r   r      st   
 "'NIs6:L(4U\\ 123:"'K$'%,]]4%@OXc]@'+x}+%,]]4%@OXc]@9=OXd3#456=        ! !     $ $    PF Pt P$# $r   r   T)omit_defaults
array_like)r3   typingr   r   rQ   rO   vllm.adapter_commons.requestr   rJ   ImportErrorStructr   rX   r   r   <module>r_      sH     !  N
X$X$	  Os   2 ==