[Chore] Deprecate SupportsMultiModal.merge_by_field_config (#30170)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -78,9 +78,9 @@ class SupportsMultiModal(Protocol):
|
||||
`multimodal_config.mm_encoder_tp_mode="data"`.
|
||||
"""
|
||||
|
||||
merge_by_field_config: ClassVar[bool] = True
|
||||
merge_by_field_config: ClassVar[bool | None] = None
|
||||
"""
|
||||
A flag that indicates which implementation of
|
||||
[DEPRECATED] A flag that indicates which implementation of
|
||||
`vllm.multimodal.utils.group_mm_kwargs_by_modality` to use.
|
||||
"""
|
||||
|
||||
@@ -260,7 +260,26 @@ def supports_multimodal(model: object) -> TypeIs[SupportsMultiModal]: ...
|
||||
def supports_multimodal(
|
||||
model: type[object] | object,
|
||||
) -> TypeIs[type[SupportsMultiModal]] | TypeIs[SupportsMultiModal]:
|
||||
return getattr(model, "supports_multimodal", False)
|
||||
res = getattr(model, "supports_multimodal", False)
|
||||
|
||||
if res:
|
||||
# We can remove this starting from v0.14
|
||||
merge_by_field_config = getattr(model, "merge_by_field_config", None)
|
||||
if merge_by_field_config is False:
|
||||
raise ValueError(
|
||||
"`merge_by_field_config=False` is no longer effective, "
|
||||
"please update your model to consider the new batching logic "
|
||||
"in `group_mm_kwargs_by_modality` (refer to "
|
||||
"https://github.com/vllm-project/vllm/issues/26149), "
|
||||
"and then remove the override from your model."
|
||||
)
|
||||
if merge_by_field_config is True:
|
||||
logger.warning_once(
|
||||
"`merge_by_field_config=True` is redundant, "
|
||||
"please remove the override from your model."
|
||||
)
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def supports_multimodal_raw_input_only(model: type[object] | object) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user