[Chore] Remove vendored code made redundant by Transformers 5.16.1 (#60623)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bc713cf8cc
commit
2c99ee9333
@@ -16,7 +16,7 @@ via Gemma4MultimodalEmbedder.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterable, Mapping, Sequence
|
||||
from collections.abc import Iterable, Sequence
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
|
||||
@@ -25,7 +25,7 @@ import torch
|
||||
import torch._dynamo
|
||||
from torch import nn
|
||||
from torch.nn import functional as F
|
||||
from transformers import AutoModel
|
||||
from transformers import AutoModel, DiffusionGemmaConfig
|
||||
|
||||
from vllm.config import VllmConfig
|
||||
from vllm.config.compilation import CUDAGraphMode
|
||||
@@ -113,26 +113,13 @@ class DiffusionGemmaSelfConditioning(nn.Module):
|
||||
|
||||
|
||||
class DiffusionGemmaProcessingInfo(Gemma4ProcessingInfo):
|
||||
"""Processing info for DiffusionGemma.
|
||||
"""Processing info for DiffusionGemma, which has no audio tower."""
|
||||
|
||||
Overrides ``get_hf_config`` to accept ``DiffusionGemmaConfig``
|
||||
(which inherits from ``PreTrainedConfig``, not ``Gemma4Config``).
|
||||
Supports image and video modalities.
|
||||
"""
|
||||
def get_hf_config(self) -> DiffusionGemmaConfig:
|
||||
return self.ctx.get_hf_config(DiffusionGemmaConfig)
|
||||
|
||||
def get_hf_config(self):
|
||||
# DiffusionGemmaConfig doesn't inherit from Gemma4Config, so we
|
||||
# accept any PreTrainedConfig here.
|
||||
return self.ctx.get_hf_config()
|
||||
|
||||
def get_supported_mm_limits(self) -> Mapping[str, int | None]:
|
||||
# DiffusionGemma supports image and video inputs.
|
||||
return {"image": None, "video": None}
|
||||
|
||||
def get_mm_max_tokens_per_item(
|
||||
self, seq_len: int, mm_counts: Mapping[str, int]
|
||||
) -> Mapping[str, int] | None:
|
||||
return super().get_mm_max_tokens_per_item(seq_len, mm_counts)
|
||||
def has_audio(self) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
@torch.compile(dynamic=True, backend=current_platform.simple_compile_backend)
|
||||
|
||||
Reference in New Issue
Block a user