[Bugfix] Fix HunyuanVL XD-RoPE (#29593)

Signed-off-by: Roger Wang <hey@rogerw.io>
Co-authored by: grider-transwithai <grider@transwith.ai>
This commit is contained in:
Roger Wang 2025-11-27 04:36:24 -08:00 committed by GitHub
parent a5abd1d384
commit cf348c8d27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -847,7 +847,7 @@ class HunYuanVLForConditionalGeneration(
.expand(-1, llm_grid_w + 1) .expand(-1, llm_grid_w + 1)
.reshape(-1) .reshape(-1)
) )
h_index[pos : pos + token_num] = 0 t_index[pos : pos + token_num] = image_index
if xd_num == 4: if xd_num == 4:
llm_positions = torch.stack([p_index, w_index, h_index, t_index]) llm_positions = torch.stack([p_index, w_index, h_index, t_index])

View File

@ -195,9 +195,9 @@ class HunYuanVLImageProcessor(BaseImageProcessor):
processed_images = [] processed_images = []
for image in images: for image in images:
if do_resize: if do_resize:
resized_width, resized_height = smart_resize( resized_height, resized_width = smart_resize(
width, height=height,
height, width=width,
factor=patch_size * merge_size, factor=patch_size * merge_size,
min_pixels=self.min_pixels, min_pixels=self.min_pixels,
max_pixels=self.max_pixels, max_pixels=self.max_pixels,