[VLM] Clean up models (#16873)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-04-19 20:13:06 +08:00
committed by GitHub
parent 5124f5bf51
commit 205d84aaa9
4 changed files with 2 additions and 42 deletions

View File

@@ -503,26 +503,6 @@ class Phi4MMProcessingInfo(BaseProcessingInfo):
def get_supported_mm_limits(self) -> Mapping[str, Optional[int]]:
return {"audio": None, "image": None}
def get_mm_max_tokens_per_item(
self,
seq_len: int,
mm_counts: Mapping[str, int],
) -> Mapping[str, int]:
return {
"image": self.get_max_image_tokens(),
"audio": self.get_max_audio_tokens(),
}
def get_max_audio_tokens(self) -> int:
sr = self.get_feature_extractor().sampling_rate
num_frames = self.get_audio_num_frames(_AUDIO_MAX_SOUNDFILE_SIZE, sr)
return self._compute_audio_embed_size(num_frames)
def get_max_image_tokens(self) -> int:
target_width, target_height = self.get_image_size_with_most_features()
return self.get_num_image_tokens(image_width=target_width,
image_height=target_height)
def _find_target_aspect_ratio(
self,
orig_width: int,
@@ -764,9 +744,6 @@ class Phi4MMDummyInputsBuilder(BaseDummyInputsBuilder[Phi4MMProcessingInfo]):
num_audios = mm_counts.get("audio", 0)
num_images = mm_counts.get("image", 0)
target_width, target_height = \
self.info.get_image_size_with_most_features()
target_width, target_height = \
self.info.get_image_size_with_most_features()