[Misc] Remove more get_input_embeddings_v0 (#25857)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -44,13 +44,7 @@ from vllm.utils.tensor_schema import TensorSchema, TensorShape
|
||||
from .idefics2_vision_model import Idefics2VisionTransformer
|
||||
from .interfaces import MultiModalEmbeddings, SupportsLoRA, SupportsMultiModal
|
||||
from .utils import (AutoWeightsLoader, WeightsMapper, flatten_bn,
|
||||
init_vllm_registered_model, maybe_prefix,
|
||||
merge_multimodal_embeddings)
|
||||
|
||||
# <|endoftext10|> (see vocab.json in hf model)
|
||||
_IMAGE_PLACEHOLDER_TOKEN_ID = 200010
|
||||
# <|endoftext11|>
|
||||
_AUDIO_PLACEHOLDER_TOKEN_ID = 200011
|
||||
init_vllm_registered_model, maybe_prefix)
|
||||
|
||||
_AUDIO_MAX_SOUNDFILE_SIZE = 241_000
|
||||
|
||||
@@ -1371,35 +1365,6 @@ class Phi4MultimodalForCausalLM(nn.Module, SupportsLoRA, SupportsMultiModal):
|
||||
|
||||
return multimodal_embeddings
|
||||
|
||||
def get_input_embeddings_v0(
|
||||
self,
|
||||
input_ids: torch.Tensor,
|
||||
image_input: Optional[Phi4MMImagePixelInputs] = None,
|
||||
audio_input: Optional[Phi4MMAudioFeatureInputs] = None,
|
||||
) -> torch.Tensor:
|
||||
audio_projection_mode = 'speech'
|
||||
inputs_embeds = self.get_input_embeddings(input_ids)
|
||||
if image_input is not None:
|
||||
image_embeds = self._process_image_input(image_input)
|
||||
inputs_embeds = merge_multimodal_embeddings(
|
||||
input_ids,
|
||||
inputs_embeds,
|
||||
image_embeds,
|
||||
placeholder_token_id=_IMAGE_PLACEHOLDER_TOKEN_ID,
|
||||
)
|
||||
audio_projection_mode = 'vision'
|
||||
|
||||
if audio_input is not None:
|
||||
audio_embeds = self._process_audio_input(
|
||||
audio_input, audio_projection_mode=audio_projection_mode)
|
||||
inputs_embeds = merge_multimodal_embeddings(
|
||||
input_ids,
|
||||
inputs_embeds,
|
||||
audio_embeds,
|
||||
placeholder_token_id=_AUDIO_PLACEHOLDER_TOKEN_ID,
|
||||
)
|
||||
return inputs_embeds
|
||||
|
||||
def forward(
|
||||
self,
|
||||
input_ids: torch.Tensor,
|
||||
|
||||
Reference in New Issue
Block a user