[Core] LoRA V1 - Add add/pin/list/remove_lora functions (#13705)

This commit is contained in:
Varun Sundar Rabindranath
2025-02-25 13:48:02 +05:30
committed by GitHub
parent 4d251ad00e
commit 03f48b3db6
8 changed files with 270 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ import time
from concurrent.futures import Future
from inspect import isclass, signature
from multiprocessing.connection import Connection
from typing import Any, List, Optional, Tuple, Type
from typing import Any, List, Optional, Set, Tuple, Type
import msgspec
import psutil
@@ -222,8 +222,17 @@ class EngineCore:
def execute_dummy_batch(self):
self.model_executor.collective_rpc("execute_dummy_batch")
def add_lora(self, lora_request: LoRARequest) -> None:
self.model_executor.add_lora(lora_request)
def add_lora(self, lora_request: LoRARequest) -> bool:
return self.model_executor.add_lora(lora_request)
def remove_lora(self, lora_id: int) -> bool:
return self.model_executor.remove_lora(lora_id)
def list_loras(self) -> Set[int]:
return self.model_executor.list_loras()
def pin_lora(self, lora_id: int) -> bool:
return self.model_executor.pin_lora(lora_id)
class EngineCoreProc(EngineCore):