|
4 | 4 |
|
5 | 5 | import numpy as np |
6 | 6 | import torch |
7 | | -from transformers import PretrainedConfig |
8 | 7 |
|
9 | 8 | from vllm.triton_utils import tl, triton |
10 | 9 |
|
@@ -376,39 +375,6 @@ def forward_cpu( |
376 | 375 | ) -> tuple[torch.Tensor, torch.Tensor | None]: |
377 | 376 | return self.forward_native(positions, query, key, offsets) |
378 | 377 |
|
379 | | - @classmethod |
380 | | - def get_input_positions( |
381 | | - cls, |
382 | | - input_tokens: list[int], |
383 | | - hf_config: PretrainedConfig, |
384 | | - image_grid_thw: list[list[int]] | torch.Tensor | None, |
385 | | - video_grid_thw: list[list[int]] | torch.Tensor | None, |
386 | | - second_per_grid_ts: list[float] | None, |
387 | | - context_len: int = 0, |
388 | | - seq_len: int | None = None, |
389 | | - audio_feature_lengths: torch.Tensor | None = None, |
390 | | - use_audio_in_video: bool = False, |
391 | | - ) -> tuple[list[list[int]], int]: |
392 | | - """Get mrope input positions and delta value.""" |
393 | | - |
394 | | - image_grid_thw = [] if image_grid_thw is None else image_grid_thw |
395 | | - video_grid_thw = [] if video_grid_thw is None else video_grid_thw |
396 | | - second_per_grid_ts = [] if second_per_grid_ts is None else second_per_grid_ts |
397 | | - |
398 | | - llm_positions, mrope_position_delta = cls.get_input_positions_tensor( |
399 | | - input_tokens=input_tokens, |
400 | | - hf_config=hf_config, |
401 | | - image_grid_thw=image_grid_thw, |
402 | | - video_grid_thw=video_grid_thw, |
403 | | - second_per_grid_ts=second_per_grid_ts, |
404 | | - context_len=context_len, |
405 | | - seq_len=seq_len, |
406 | | - audio_feature_lengths=audio_feature_lengths, |
407 | | - use_audio_in_video=use_audio_in_video, |
408 | | - ) |
409 | | - |
410 | | - return llm_positions.tolist(), mrope_position_delta |
411 | | - |
412 | 378 | @staticmethod |
413 | 379 | def get_next_input_positions( |
414 | 380 | mrope_position_delta: int, |
|
0 commit comments