[Misc] Raise error when using encoder/decoder model with cpu backend (#8355)

This commit is contained in:
Kevin Lin
2024-09-12 05:45:24 +00:00
committed by GitHub
parent 1bf2dd9df0
commit 295c4730a8
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -15,7 +15,7 @@ from vllm.model_executor.model_loader import get_model
from vllm.multimodal import (MULTIMODAL_REGISTRY, BatchedTensorInputs,
MultiModalInputs)
from vllm.sequence import IntermediateTensors, SequenceGroupMetadata
from vllm.utils import make_tensor_with_pad
from vllm.utils import STR_NOT_IMPL_ENC_DEC_ERR_STRS, make_tensor_with_pad
from vllm.worker.model_runner_base import (
ModelRunnerBase, ModelRunnerInputBase,
_add_attn_metadata_broadcastable_dict,
@@ -121,6 +121,10 @@ class CPUModelRunner(ModelRunnerBase[CPUModelInput]):
# Lazy initialization.
self.model: nn.Module # Set after init_Model
if self.model_config.is_encoder_decoder_model:
raise NotImplementedError(
STR_NOT_IMPL_ENC_DEC_ERR_STRS['STR_NOT_IMPL_ENC_DEC_CPU'])
def load_model(self) -> None:
self.model = get_model(model_config=self.model_config,
load_config=self.load_config,