Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/transformers/models/glm46v/modeling_glm46v.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- GLM46V uses timestamps to seperate each video frame, so the video_grid_thw should also be split too.
- GLM46V uses timestamps to separate each video frame, so the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -195,7 +195,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/glm4v/modeling_glm4v.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- GLM4V uses timestamps to seperate each video frame, so the video_grid_thw should also be split too.
- GLM4V uses timestamps to separate each video frame, so the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -1038,7 +1038,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/glm4v/modular_glm4v.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- GLM4V uses timestamps to seperate each video frame, so the video_grid_thw should also be split too.
- GLM4V uses timestamps to separate each video frame, so the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -907,7 +907,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/glm4v_moe/modeling_glm4v_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- GLM4V_MOE uses timestamps to seperate each video frame, so the video_grid_thw should also be split too.
- GLM4V_MOE uses timestamps to separate each video frame, so the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -1207,7 +1207,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/glm_ocr/modeling_glm_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- GLM_OCR uses timestamps to seperate each video frame, so the video_grid_thw should also be split too.
- GLM_OCR uses timestamps to separate each video frame, so the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -954,7 +954,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/qwen3_5/modeling_qwen3_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- Since Qwen3.5 use timestamps to seperate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.
- Since Qwen3.5 use timestamps to separate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -1419,7 +1419,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/qwen3_5_moe/modeling_qwen3_5_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- Since Qwen3.5 use timestamps to seperate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.
- Since Qwen3.5 use timestamps to separate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -1544,7 +1544,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/qwen3_vl/modeling_qwen3_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- Since Qwen3.5 use timestamps to seperate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.
- Since Qwen3.5 use timestamps to separate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -1064,7 +1064,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/qwen3_vl/modular_qwen3_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- Since Qwen3.5 use timestamps to seperate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.
- Since Qwen3.5 use timestamps to separate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -764,7 +764,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/qwen3_vl_moe/modeling_qwen3_vl_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ def get_rope_index(
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Difference from Qwen2VL/Qwen2.5VL's get_rope_index:
- Since Qwen3.5 use timestamps to seperate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.
- Since Qwen3.5 use timestamps to separate videos, like <t1> <vision_start> <frame1> <vision_end> <t2> <vision_start> <frame2> <vision_end>, the video_grid_thw should also be split too.

Args:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
Expand All @@ -1193,7 +1193,7 @@ def get_rope_index(
mrope_position_deltas (`torch.Tensor` of shape `(batch_size)`)
"""

# Separate video grid thw into multiple grids because timestamps are used to seperate videos.
# Separate video grid thw into multiple grids because timestamps are used to separate videos.
if video_grid_thw is not None:
video_grid_thw = torch.repeat_interleave(video_grid_thw, video_grid_thw[:, 0], dim=0)
video_grid_thw[:, 0] = 1
Expand Down
Loading