[MRV2] Generalize use of WhisperModelState (#46096)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2026-06-22 12:40:02 -07:00
committed by GitHub
parent 44d95069e9
commit fbf520cf3a
4 changed files with 38 additions and 43 deletions
+18 -2
View File
@@ -46,9 +46,25 @@ class ModelState(ABC):
) -> None:
raise NotImplementedError
@abstractmethod
model: nn.Module
def get_supported_generation_tasks(self) -> tuple[GenerationTask, ...]:
raise NotImplementedError
from vllm.model_executor.models.interfaces import (
supports_realtime,
supports_transcription,
)
from vllm.model_executor.models.interfaces_base import is_text_generation_model
supported_tasks = list[GenerationTask]()
if is_text_generation_model(self.model):
supported_tasks.append("generate")
if supports_transcription(self.model):
if self.model.supports_transcription_only:
return ("transcription",)
supported_tasks.append("transcription")
if supports_realtime(self.model):
supported_tasks.append("realtime")
return tuple(supported_tasks)
def add_request(self, req_index: int, new_req_data: NewRequestData) -> None:
return None