[Misc] Replaced asserts with proper exceptions to improve UX for pooling (#44593)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
This commit is contained in:
@@ -124,7 +124,10 @@ def pooler_for_token_classify(
|
||||
|
||||
vllm_config = get_current_vllm_config()
|
||||
model_config = vllm_config.model_config
|
||||
assert model_config.pooler_config is not None
|
||||
if model_config.pooler_config is None:
|
||||
raise ValueError(
|
||||
"model_config.pooler_config must be set for token classification pooling"
|
||||
)
|
||||
head = TokenClassifierPoolerHead(
|
||||
head_dtype=model_config.head_dtype,
|
||||
classifier=classifier,
|
||||
|
||||
Reference in New Issue
Block a user