[Bugfix] Make get_mrope_input_positions instance methods (#27342)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-10-22 23:38:34 +08:00
committed by GitHub
parent 7c4767f1eb
commit 14e2f1231e
7 changed files with 6 additions and 13 deletions

View File

@@ -1404,9 +1404,8 @@ class Ernie4_5_VLMoeForConditionalGeneration(
else:
self.visual_token_mask = None
@classmethod
def get_mrope_input_positions(
cls,
self,
input_tokens: list[int],
hf_config: PretrainedConfig,
image_grid_thw: list[list[int]] | torch.Tensor,

View File

@@ -619,9 +619,8 @@ class GLM4VForCausalLM(
return self.transformer.vision(pixel_values)
@classmethod
def get_mrope_input_positions(
cls,
self,
input_tokens: list[int],
hf_config: PretrainedConfig,
image_grid_thw: list[list[int]] | torch.Tensor,

View File

@@ -594,9 +594,8 @@ class KeyeVL1_5ForConditionalGeneration(
new_video_embeds.append(video_embeds[start:end])
return tuple(new_video_embeds)
@classmethod
def get_mrope_input_positions(
cls,
self,
input_tokens: list[int],
hf_config: PretrainedConfig,
image_grid_thw: list[list[int]] | torch.Tensor,

View File

@@ -986,9 +986,8 @@ class Qwen2_5OmniThinkerForConditionalGeneration(
def get_language_model(self) -> torch.nn.Module:
return self.language_model
@classmethod
def get_mrope_input_positions(
cls,
self,
input_tokens: list[int],
hf_config: PretrainedConfig,
image_grid_thw: list[list[int]] | torch.Tensor,

View File

@@ -1078,9 +1078,8 @@ class Qwen2_5_VLForConditionalGeneration(
supports_encoder_tp_data = True
@classmethod
def get_mrope_input_positions(
cls,
self,
input_tokens: list[int],
hf_config: PretrainedConfig,
image_grid_thw: list[list[int]] | torch.Tensor,

View File

@@ -1421,7 +1421,6 @@ class Qwen3OmniMoeThinkerForConditionalGeneration(
return loaded_weights
@classmethod
def get_mrope_input_positions(
self,
input_tokens: list[int],

View File

@@ -1480,9 +1480,8 @@ class Qwen3VLForConditionalGeneration(
)
return mm_input_by_modality
@classmethod
def get_mrope_input_positions(
cls,
self,
input_tokens: list[int],
hf_config: PretrainedConfig,
image_grid_thw: list[list[int]] | torch.Tensor,