[Frontend][3/n] Improve pooling entrypoints | scoring. (#28631)
Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
from vllm.config import ModelConfig
|
||||
from vllm.entrypoints.chat_utils import ChatTemplateConfig
|
||||
from vllm.entrypoints.pooling.base.io_processor import PoolingIOProcessor
|
||||
from vllm.entrypoints.pooling.scoring.io_processor import ScoringIOProcessors
|
||||
from vllm.entrypoints.pooling.utils import enable_scoring_api
|
||||
from vllm.renderers import BaseRenderer
|
||||
from vllm.tasks import SupportedTask
|
||||
|
||||
@@ -25,6 +27,11 @@ def init_pooling_io_processors(
|
||||
|
||||
processors.append(("embed", EmbedIOProcessor))
|
||||
|
||||
if enable_scoring_api(supported_tasks, model_config):
|
||||
score_type = model_config.score_type
|
||||
if score_type is not None and score_type in ScoringIOProcessors:
|
||||
processors.append((score_type, ScoringIOProcessors[score_type]))
|
||||
|
||||
return {
|
||||
task: processor_cls(
|
||||
model_config=model_config,
|
||||
|
||||
Reference in New Issue
Block a user