fix(pooling): validate BGE-M3 combined task ownership (#51823)
Signed-off-by: Zhe Li <2843409461@qq.com> Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
@@ -65,10 +65,16 @@ def init_pooling_io_processors(
|
||||
|
||||
processors["token_embed"] = TokenEmbedIOProcessor
|
||||
|
||||
if has_io_processor(
|
||||
if pooling_task == "embed&token_classify":
|
||||
from .pooling.io_processor import UnsupportedCombinedTaskIOProcessor
|
||||
|
||||
processors[pooling_task] = UnsupportedCombinedTaskIOProcessor
|
||||
|
||||
has_plugin = has_io_processor(
|
||||
vllm_config,
|
||||
model_config.io_processor_plugin,
|
||||
):
|
||||
)
|
||||
if has_plugin:
|
||||
from .pooling.io_processor import PluginWithIOProcessorPlugins
|
||||
|
||||
processors["plugin"] = PluginWithIOProcessorPlugins
|
||||
|
||||
@@ -24,6 +24,18 @@ from .protocol import IOProcessorRequest, IOProcessorResponse
|
||||
logger = init_logger(__name__)
|
||||
|
||||
|
||||
class UnsupportedCombinedTaskIOProcessor(PoolingIOProcessor):
|
||||
name = "embed&token_classify"
|
||||
|
||||
def create_pooling_params(self, request):
|
||||
raise ValueError(
|
||||
"The 'embed&token_classify' pooling task is only available "
|
||||
"through an IO processor plugin. Send a plugin request with "
|
||||
"a 'data' field, "
|
||||
"or select a concrete task with --pooler-config.task."
|
||||
)
|
||||
|
||||
|
||||
class PluginWithoutIOProcessorPlugins(PoolingIOProcessor):
|
||||
# Some models, such as Terratorch (tests/models/test_terratorch.py),
|
||||
# use plugin tasks in the pooler but do not use IO Processor plugins.
|
||||
|
||||
Reference in New Issue
Block a user