[LoRA] Add support for pinning lora adapters in the LRU cache (#5603)
This commit is contained in:
@@ -70,6 +70,10 @@ class WorkerBase(ABC):
|
||||
def remove_lora(self, lora_id: int) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def pin_lora(self, lora_id: int) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def list_loras(self) -> Set[int]:
|
||||
raise NotImplementedError
|
||||
@@ -86,6 +90,10 @@ class LoraNotSupportedWorkerBase(WorkerBase):
|
||||
def remove_lora(self, lora_id: int) -> bool:
|
||||
raise ValueError(f"{type(self)} does not support LoRA")
|
||||
|
||||
def pin_lora(self, lora_id: int) -> bool:
|
||||
return ValueError(
|
||||
f"{type(self)} does not support LoRA") # type: ignore
|
||||
|
||||
def list_loras(self) -> Set[int]:
|
||||
raise ValueError(f"{type(self)} does not support LoRA")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user