[Frontend][Core] Standardize request error handling with VLLMError hierarchy (#49665)
Signed-off-by: Zach Zhu <zzqshu@126.com>
This commit is contained in:
@@ -7,6 +7,8 @@ from typing import TYPE_CHECKING, Literal, TypeAlias
|
||||
|
||||
from typing_extensions import NotRequired, TypedDict, assert_never
|
||||
|
||||
from vllm.exceptions import VLLMValidationError
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import torch
|
||||
|
||||
@@ -284,7 +286,7 @@ which can be passed to `LLMEngine.add_request` or `AsyncLLM.add_request`.
|
||||
|
||||
def _validate_enc_input(enc_input: SingletonInput) -> EncoderInput:
|
||||
if enc_input["type"] == "embeds":
|
||||
raise ValueError(
|
||||
raise VLLMValidationError(
|
||||
"Embedding inputs are not supported for encoder-decoder models"
|
||||
)
|
||||
|
||||
@@ -302,7 +304,7 @@ def _validate_enc_input(enc_input: SingletonInput) -> EncoderInput:
|
||||
|
||||
def _validate_dec_input(dec_input: SingletonInput) -> DecoderEngineInput:
|
||||
if dec_input["type"] == "embeds":
|
||||
raise ValueError(
|
||||
raise VLLMValidationError(
|
||||
"Embedding inputs are not supported for encoder-decoder models"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user