[MM] Simplify _apply_hf_processor_main (#53275)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -262,9 +262,6 @@ class InputProcessingContext:
|
||||
hf_processor: Callable[..., BatchFeature] | ProcessorMixin,
|
||||
data: Mapping[str, object],
|
||||
kwargs: Mapping[str, object] = {},
|
||||
*,
|
||||
num_tries: int = 1,
|
||||
max_tries: int = 5,
|
||||
) -> BatchFeature:
|
||||
"""
|
||||
Call `hf_processor` on the prompt `data`
|
||||
@@ -274,6 +271,12 @@ class InputProcessingContext:
|
||||
|
||||
merged_kwargs = self.get_merged_mm_kwargs(kwargs)
|
||||
|
||||
# vLLM needs the full untruncated sequence to keep multi-modal
|
||||
# placeholder tokens aligned; note that the text inputs in
|
||||
# call_hf_processor are just dummy text, not the original prompt.
|
||||
# The original prompt is already tokenized by the renderer.
|
||||
merged_kwargs.setdefault("truncation", False)
|
||||
|
||||
allowed_kwargs = get_allowed_kwarg_only_overrides(
|
||||
hf_processor,
|
||||
merged_kwargs,
|
||||
|
||||
Reference in New Issue
Block a user