Bump Transformers version to 5.13.0 (#47867)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -73,6 +73,7 @@ from vllm.multimodal.processing import (
|
||||
BaseProcessingInfo,
|
||||
PromptReplacement,
|
||||
PromptUpdate,
|
||||
PromptUpdateDetails,
|
||||
)
|
||||
from vllm.sequence import IntermediateTensors
|
||||
from vllm.transformers_utils.configs.hunyuan_vl import (
|
||||
@@ -751,8 +752,10 @@ class HunYuanVLMultiModalProcessor(BaseMultiModalProcessor[HunYuanVLProcessingIn
|
||||
hf_processor = self.info.get_hf_processor(**hf_processor_mm_kwargs)
|
||||
image_processor = self.info.get_image_processor(**hf_processor_mm_kwargs)
|
||||
|
||||
placeholder = {
|
||||
token_ids = {
|
||||
"image": hf_processor.image_token_id,
|
||||
"image_start": hf_processor.image_start_token_id,
|
||||
"image_end": hf_processor.image_end_token_id,
|
||||
}
|
||||
|
||||
merge_size = image_processor.merge_size
|
||||
@@ -766,12 +769,17 @@ class HunYuanVLMultiModalProcessor(BaseMultiModalProcessor[HunYuanVLProcessingIn
|
||||
num_tokens = (int(grid_h) // merge_size) * (
|
||||
int(grid_w) // merge_size + 1
|
||||
) + 2
|
||||
return [placeholder[modality]] * num_tokens
|
||||
tokens = (
|
||||
[token_ids[f"{modality}_start"]]
|
||||
+ [token_ids[modality]] * num_tokens
|
||||
+ [token_ids[f"{modality}_end"]]
|
||||
)
|
||||
return PromptUpdateDetails.select_token_id(tokens, token_ids[modality])
|
||||
|
||||
return [
|
||||
PromptReplacement(
|
||||
modality=modality,
|
||||
target=[placeholder[modality]],
|
||||
target=[token_ids[modality]],
|
||||
replacement=partial(get_replacement_hunyuan_vl, modality=modality),
|
||||
)
|
||||
for modality in ("image",)
|
||||
|
||||
Reference in New Issue
Block a user