1- from dataclasses import dataclass
1+ import warnings
2+ from dataclasses import dataclass , field
23from typing import Optional
34
45from vllm .adapter_commons .request import AdapterRequest
@@ -20,10 +21,25 @@ class LoRARequest(AdapterRequest):
2021
2122 lora_name : str
2223 lora_int_id : int
23- lora_path : str
24+ lora_path : str = ""
25+ lora_local_path : Optional [str ] = field (default = None , repr = False )
2426 long_lora_max_len : Optional [int ] = None
2527 __hash__ = AdapterRequest .__hash__
2628
29+ def __post_init__ (self ):
30+ if 'lora_local_path' in self .__dict__ :
31+ warnings .warn (
32+ "The 'lora_local_path' attribute is deprecated "
33+ "and will be removed in a future version. "
34+ "Please use 'lora_path' instead." ,
35+ DeprecationWarning ,
36+ stacklevel = 2 )
37+ if not self .lora_path :
38+ self .lora_path = self .lora_local_path or ""
39+
40+ # Ensure lora_path is not empty
41+ assert self .lora_path , "lora_path can not be empty"
42+
2743 @property
2844 def adapter_id (self ):
2945 return self .lora_int_id
@@ -32,6 +48,26 @@ def adapter_id(self):
3248 def name (self ):
3349 return self .lora_name
3450
51+ @property
52+ def path (self ):
53+ return self .lora_path
54+
3555 @property
3656 def local_path (self ):
37- return self .lora_local_path
57+ warnings .warn (
58+ "The 'local_path' attribute is deprecated "
59+ "and will be removed in a future version. "
60+ "Please use 'path' instead." ,
61+ DeprecationWarning ,
62+ stacklevel = 2 )
63+ return self .lora_path
64+
65+ @local_path .setter
66+ def local_path (self , value ):
67+ warnings .warn (
68+ "The 'local_path' attribute is deprecated "
69+ "and will be removed in a future version. "
70+ "Please use 'path' instead." ,
71+ DeprecationWarning ,
72+ stacklevel = 2 )
73+ self .lora_path = value
0 commit comments