Fix duplicate HunyuanVL image boundary tokens (#49691)
Co-authored-by: Jiazhi Mi <jiazhimi@tencent.com>
This commit is contained in:
@@ -698,9 +698,12 @@ class HunYuanVLDummyInputsBuilder(BaseDummyInputsBuilder[HunYuanVLProcessingInfo
|
||||
num_images = mm_counts.get("image", 0)
|
||||
|
||||
hf_processor = self.info.get_hf_processor(typ=HunYuanVLProcessor)
|
||||
image_token: str = hf_processor.image_token
|
||||
image_placeholder = (
|
||||
f"{hf_processor.image_start_token}{hf_processor.image_token}"
|
||||
f"{hf_processor.image_end_token}"
|
||||
)
|
||||
|
||||
return image_token * num_images
|
||||
return image_placeholder * num_images
|
||||
|
||||
def get_dummy_mm_data(
|
||||
self,
|
||||
@@ -779,7 +782,11 @@ class HunYuanVLMultiModalProcessor(BaseMultiModalProcessor[HunYuanVLProcessingIn
|
||||
return [
|
||||
PromptReplacement(
|
||||
modality=modality,
|
||||
target=[token_ids[modality]],
|
||||
target=[
|
||||
token_ids[f"{modality}_start"],
|
||||
token_ids[modality],
|
||||
token_ids[f"{modality}_end"],
|
||||
],
|
||||
replacement=partial(get_replacement_hunyuan_vl, modality=modality),
|
||||
)
|
||||
for modality in ("image",)
|
||||
|
||||
Reference in New Issue
Block a user