[Chore] Use Transformers v5 names and drop redundant processor use_fast (#58550)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
484c211fe8
commit
d881812500
@@ -31,7 +31,7 @@ from typing import Annotated
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from torch import nn
|
||||
from transformers import BatchFeature, PretrainedConfig
|
||||
from transformers import BatchFeature, PreTrainedConfig
|
||||
|
||||
from vllm.config import CacheConfig, ModelConfig, SpeechToTextConfig, VllmConfig
|
||||
from vllm.config.multimodal import MultiModalDummyOptions
|
||||
@@ -229,7 +229,7 @@ class GraniteSpeechDummyInputsBuilder(
|
||||
class GraniteSpeechEncoderProjector(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
cache_config: CacheConfig,
|
||||
quant_config: QuantizationConfig | None = None,
|
||||
prefix: str = "",
|
||||
@@ -287,7 +287,7 @@ class GraniteSpeechConformerFeedForward(nn.Module):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
quant_config: QuantizationConfig | None = None,
|
||||
prefix: str = "",
|
||||
):
|
||||
@@ -323,7 +323,7 @@ class GraniteSpeechConformerAttention(nn.Module):
|
||||
for more details.
|
||||
"""
|
||||
|
||||
def __init__(self, config: PretrainedConfig, prefix: str = ""):
|
||||
def __init__(self, config: PreTrainedConfig, prefix: str = ""):
|
||||
super().__init__()
|
||||
|
||||
inner_dim = config.dim_head * config.num_heads
|
||||
@@ -429,7 +429,7 @@ class GraniteSpeechConformerConvModule(nn.Module):
|
||||
convolutional layers.
|
||||
"""
|
||||
|
||||
def __init__(self, config: PretrainedConfig, prefix: str = ""):
|
||||
def __init__(self, config: PreTrainedConfig, prefix: str = ""):
|
||||
super().__init__()
|
||||
inner_dim = config.hidden_dim * config.conv_expansion_factor
|
||||
|
||||
@@ -460,7 +460,7 @@ class GraniteSpeechConformerBlock(nn.Module):
|
||||
"""Conformer block, consisting largely of linear layers,
|
||||
attention, and convolutional layers."""
|
||||
|
||||
def __init__(self, config: PretrainedConfig, prefix: str = ""):
|
||||
def __init__(self, config: PreTrainedConfig, prefix: str = ""):
|
||||
super().__init__()
|
||||
self.ff1 = GraniteSpeechConformerFeedForward(config, prefix=f"{prefix}.ff1")
|
||||
self.attn = GraniteSpeechConformerAttention(config, prefix=f"{prefix}.attn")
|
||||
@@ -486,7 +486,7 @@ class GraniteSpeechCTCEncoder(nn.Module):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
prefix: str,
|
||||
quant_config: QuantizationConfig | None = None,
|
||||
):
|
||||
@@ -622,7 +622,7 @@ class GraniteSpeechForConditionalGeneration(
|
||||
|
||||
def _build_encoder(
|
||||
self,
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
quant_config: QuantizationConfig | None,
|
||||
prefix: str,
|
||||
) -> "GraniteSpeechCTCEncoder":
|
||||
|
||||
Reference in New Issue
Block a user