vllm/vllm/adapter_commons/worker_manager.py
Swapnil Parekh 4d6ada947c
[CORE] Adding support for insertion of soft-tuned prompts (#4645)
Co-authored-by: Swapnil Parekh <swapnilp@ibm.com>
Co-authored-by: Joe G <joseph.granados@h2o.ai>
Co-authored-by: Antoni Baum <antoni.baum@protonmail.com>
2024-07-09 13:26:36 -07:00

37 lines
749 B
Python

from abc import ABC, abstractmethod
from typing import Any, Optional, Set
import torch
class AbstractWorkerManager(ABC):
def __init__(self, device: torch.device):
self.device = device
@property
@abstractmethod
def is_enabled(self) -> bool:
...
@abstractmethod
def set_active_adapters(self, requests: Set[Any],
mapping: Optional[Any]) -> None:
...
@abstractmethod
def add_adapter(self, adapter_request: Any) -> bool:
...
@abstractmethod
def remove_adapter(self, adapter_id: int) -> bool:
...
@abstractmethod
def remove_all_adapters(self):
...
@abstractmethod
def list_adapters(self) -> Set[int]:
...