[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
@@ -17,7 +17,7 @@ import transformers.configuration_utils as hf_configuration_utils
|
||||
from huggingface_hub import constants
|
||||
from packaging.version import Version
|
||||
from safetensors.torch import _TYPES as _SAFETENSORS_TO_TORCH_DTYPE
|
||||
from transformers import GenerationConfig, PretrainedConfig
|
||||
from transformers import GenerationConfig, PreTrainedConfig
|
||||
from transformers.configuration_utils import ALLOWED_LAYER_TYPES
|
||||
from transformers.models.auto.image_processing_auto import get_image_processor_config
|
||||
from transformers.models.auto.modeling_auto import (
|
||||
@@ -86,7 +86,7 @@ class LazyConfigDict(dict):
|
||||
return getattr(configs, value)
|
||||
|
||||
|
||||
_CONFIG_REGISTRY: dict[str, type[PretrainedConfig]] = LazyConfigDict(
|
||||
_CONFIG_REGISTRY: dict[str, type[PreTrainedConfig]] = LazyConfigDict(
|
||||
afmoe="AfmoeConfig",
|
||||
axk1="AXK1Config",
|
||||
bagel="BagelConfig",
|
||||
@@ -189,13 +189,13 @@ _AUTO_CONFIG_KWARGS_OVERRIDES: dict[str, dict[str, Any]] = {
|
||||
|
||||
|
||||
def _register_config_class(
|
||||
model_type: str, config_class: type[PretrainedConfig]
|
||||
model_type: str, config_class: type[PreTrainedConfig]
|
||||
) -> None:
|
||||
config_class.model_type = model_type
|
||||
AutoConfig.register(model_type, config_class, exist_ok=True)
|
||||
|
||||
|
||||
def _maybe_register_hf_config(config: PretrainedConfig | None) -> None:
|
||||
def _maybe_register_hf_config(config: PreTrainedConfig | None) -> None:
|
||||
if config is None:
|
||||
return
|
||||
|
||||
@@ -228,7 +228,7 @@ def _mistral_patch_hf_hub_constants() -> Iterator[None]:
|
||||
def _install_hf_config_validator(
|
||||
name: str, validator: Callable, supersedes: Callable
|
||||
) -> None:
|
||||
"""Replace a ``PretrainedConfig`` validator on every ``@strict`` snapshot.
|
||||
"""Replace a ``PreTrainedConfig`` validator on every ``@strict`` snapshot.
|
||||
|
||||
``@strict`` snapshots each ``validate_*`` method into ``__class_validators__``
|
||||
at class creation and automatic post-``__init__`` validation dispatches off
|
||||
@@ -237,10 +237,10 @@ def _install_hf_config_validator(
|
||||
class owns a snapshot, so rewrite them all, matching ``supersedes`` by
|
||||
identity to leave a genuine per-model override in place.
|
||||
"""
|
||||
setattr(PretrainedConfig, name, validator)
|
||||
setattr(PreTrainedConfig, name, validator)
|
||||
|
||||
seen: set[int] = set()
|
||||
stack = [PretrainedConfig]
|
||||
stack = [PreTrainedConfig]
|
||||
while stack:
|
||||
cls = stack.pop()
|
||||
if id(cls) in seen:
|
||||
@@ -261,10 +261,10 @@ def _patch_hf_transformers_validate_rope():
|
||||
validate_rope() with the ignore_keys parameter work with newer versions of
|
||||
hf transformers (from v5 onwards)
|
||||
"""
|
||||
if hasattr(PretrainedConfig.validate_rope, "__vllm_patched__"):
|
||||
if hasattr(PreTrainedConfig.validate_rope, "__vllm_patched__"):
|
||||
return
|
||||
|
||||
_original_validate_rope = PretrainedConfig.validate_rope
|
||||
_original_validate_rope = PreTrainedConfig.validate_rope
|
||||
|
||||
@wraps(_original_validate_rope)
|
||||
def patched_validate_rope(self, *args, **kwargs):
|
||||
@@ -293,10 +293,10 @@ def _patch_hf_transformers_nested_rope_validation() -> None:
|
||||
``AttributeError``. The per-layer dicts already carry their own defaults by
|
||||
the time validation runs, so the shared entries can be dropped.
|
||||
"""
|
||||
if hasattr(PretrainedConfig.validate_rope, "__vllm_nested_rope_patched__"):
|
||||
if hasattr(PreTrainedConfig.validate_rope, "__vllm_nested_rope_patched__"):
|
||||
return
|
||||
|
||||
_original_validate_rope = PretrainedConfig.validate_rope
|
||||
_original_validate_rope = PreTrainedConfig.validate_rope
|
||||
|
||||
@wraps(_original_validate_rope)
|
||||
def patched_validate_rope(self, *args, **kwargs):
|
||||
@@ -347,11 +347,11 @@ class HFConfigParser(ConfigParserBase):
|
||||
revision: str | None = None,
|
||||
code_revision: str | None = None,
|
||||
**kwargs,
|
||||
) -> tuple[dict, PretrainedConfig]:
|
||||
) -> tuple[dict, PreTrainedConfig]:
|
||||
kwargs["local_files_only"] = huggingface_hub.constants.HF_HUB_OFFLINE
|
||||
trust_remote_code |= kwargs.get("trust_remote_code", False)
|
||||
kwargs = without_trust_remote_code(kwargs)
|
||||
config_dict, _ = PretrainedConfig.get_config_dict(
|
||||
config_dict, _ = PreTrainedConfig.get_config_dict(
|
||||
model,
|
||||
revision=revision,
|
||||
code_revision=code_revision,
|
||||
@@ -374,7 +374,7 @@ class HFConfigParser(ConfigParserBase):
|
||||
# through and remain unchanged by this elif block
|
||||
dummy_model_type = f"dummy_{model_type}"
|
||||
dummy_kwargs = dict(architectures=[""], model_type=dummy_model_type)
|
||||
dummy_config = PretrainedConfig(**dummy_kwargs)
|
||||
dummy_config = PreTrainedConfig(**dummy_kwargs)
|
||||
dummy_model_type = hf_overrides(dummy_config).model_type
|
||||
model_type = dummy_model_type.removeprefix("dummy_")
|
||||
|
||||
@@ -450,7 +450,7 @@ class MistralConfigParser(ConfigParserBase):
|
||||
revision: str | None = None,
|
||||
code_revision: str | None = None,
|
||||
**kwargs,
|
||||
) -> tuple[dict, PretrainedConfig]:
|
||||
) -> tuple[dict, PreTrainedConfig]:
|
||||
# This function loads a params.json config which
|
||||
# should be used when loading models in mistral format
|
||||
config_dict = _download_mistral_config_file(model, revision)
|
||||
@@ -466,7 +466,7 @@ class MistralConfigParser(ConfigParserBase):
|
||||
|
||||
# Get missing fields from HF config if available
|
||||
try:
|
||||
hf_config_dict, _ = PretrainedConfig.get_config_dict(
|
||||
hf_config_dict, _ = PreTrainedConfig.get_config_dict(
|
||||
model,
|
||||
revision=revision,
|
||||
code_revision=code_revision,
|
||||
@@ -540,7 +540,7 @@ def register_config_parser(config_format: str):
|
||||
... revision: str | None = None,
|
||||
... code_revision: str | None = None,
|
||||
... **kwargs,
|
||||
... ) -> tuple[dict, PretrainedConfig]:
|
||||
... ) -> tuple[dict, PreTrainedConfig]:
|
||||
... raise NotImplementedError
|
||||
>>>
|
||||
>>> type(get_config_parser("custom_config_parser"))
|
||||
@@ -571,7 +571,7 @@ def register_config_parser(config_format: str):
|
||||
return _wrapper
|
||||
|
||||
|
||||
def set_default_rope_theta(config: PretrainedConfig, default_theta: float) -> None:
|
||||
def set_default_rope_theta(config: PreTrainedConfig, default_theta: float) -> None:
|
||||
"""Some models may have no rope_theta in their config but still use RoPE.
|
||||
This function sets a default rope_theta if it's missing."""
|
||||
if getattr(config, "rope_parameters", None) is None:
|
||||
@@ -639,7 +639,7 @@ def patch_legacy_rope_type(rope_parameters: dict[str, Any] | None) -> None:
|
||||
_patch_legacy_rope_type(rope_parameters)
|
||||
|
||||
|
||||
def patch_rope_parameters(config: PretrainedConfig) -> None:
|
||||
def patch_rope_parameters(config: PreTrainedConfig) -> None:
|
||||
"""Provide backwards compatibility for RoPE."""
|
||||
from vllm.config.utils import getattr_iter
|
||||
|
||||
@@ -661,7 +661,7 @@ def patch_rope_parameters(config: PretrainedConfig) -> None:
|
||||
config.validate_rope()
|
||||
|
||||
|
||||
def _iter_rope_parameters(config: PretrainedConfig) -> Iterator[dict[str, Any]]:
|
||||
def _iter_rope_parameters(config: PreTrainedConfig) -> Iterator[dict[str, Any]]:
|
||||
"""Yield a config's rope parameters, one dict per layer type if nested."""
|
||||
rope_parameters = getattr(config, "rope_parameters", None)
|
||||
if not isinstance(rope_parameters, dict):
|
||||
@@ -673,7 +673,7 @@ def _iter_rope_parameters(config: PretrainedConfig) -> Iterator[dict[str, Any]]:
|
||||
yield rope_parameters
|
||||
|
||||
|
||||
def _mrope_section(config: PretrainedConfig) -> Sequence[int] | None:
|
||||
def _mrope_section(config: PreTrainedConfig) -> Sequence[int] | None:
|
||||
"""Return the M-RoPE section this config declares, if any.
|
||||
|
||||
`xdrope_section` is the legacy name HunYuan-VL checkpoints use for the same
|
||||
@@ -700,11 +700,11 @@ def _mrope_section(config: PretrainedConfig) -> Sequence[int] | None:
|
||||
return section if isinstance(section, (list, tuple)) else None
|
||||
|
||||
|
||||
def _uses_mrope(config: PretrainedConfig) -> bool:
|
||||
def _uses_mrope(config: PreTrainedConfig) -> bool:
|
||||
return _mrope_section(config) is not None
|
||||
|
||||
|
||||
def uses_mrope(config: PretrainedConfig) -> bool:
|
||||
def uses_mrope(config: PreTrainedConfig) -> bool:
|
||||
"""Detect if the model with this config uses M-ROPE."""
|
||||
return (
|
||||
_uses_mrope(config)
|
||||
@@ -713,7 +713,7 @@ def uses_mrope(config: PretrainedConfig) -> bool:
|
||||
)
|
||||
|
||||
|
||||
def thinker_uses_mrope(config: PretrainedConfig) -> bool:
|
||||
def thinker_uses_mrope(config: PreTrainedConfig) -> bool:
|
||||
"""Detect if the model contains a thinker config and it uses M-ROPE."""
|
||||
thinker_config = getattr(config, "thinker_config", None)
|
||||
if thinker_config is None:
|
||||
@@ -726,7 +726,7 @@ def thinker_uses_mrope(config: PretrainedConfig) -> bool:
|
||||
return uses_mrope(thinker_text_config)
|
||||
|
||||
|
||||
def mrope_num_dims(config: PretrainedConfig) -> int:
|
||||
def mrope_num_dims(config: PreTrainedConfig) -> int:
|
||||
"""Number of M-RoPE position channels the model consumes.
|
||||
|
||||
Each section entry sizes one channel, so the section length is the channel
|
||||
@@ -745,10 +745,10 @@ def mrope_num_dims(config: PretrainedConfig) -> int:
|
||||
return 3
|
||||
|
||||
|
||||
def is_encoder_decoder(config: PretrainedConfig) -> bool:
|
||||
def is_encoder_decoder(config: PreTrainedConfig) -> bool:
|
||||
"""Detect if the model with this config is used as an encoder/decoder."""
|
||||
|
||||
def _is_encoder_decoder(config: PretrainedConfig) -> bool:
|
||||
def _is_encoder_decoder(config: PreTrainedConfig) -> bool:
|
||||
return getattr(config, "is_encoder_decoder", False)
|
||||
|
||||
return _is_encoder_decoder(config) or _is_encoder_decoder(config.get_text_config())
|
||||
@@ -761,7 +761,7 @@ def _maybe_update_auto_config_kwargs(kwargs: dict[str, Any], model_type: str):
|
||||
return kwargs
|
||||
|
||||
|
||||
def _maybe_remap_hf_config_attrs(config: PretrainedConfig) -> PretrainedConfig:
|
||||
def _maybe_remap_hf_config_attrs(config: PreTrainedConfig) -> PreTrainedConfig:
|
||||
"""Remap config attributes to match the expected names."""
|
||||
for old_attr, new_attr in _CONFIG_ATTRS_MAPPING.items():
|
||||
if hasattr(config, old_attr):
|
||||
@@ -798,7 +798,7 @@ def maybe_override_with_speculators(
|
||||
|
||||
"""
|
||||
kwargs["local_files_only"] = huggingface_hub.constants.HF_HUB_OFFLINE
|
||||
config_dict, _ = PretrainedConfig.get_config_dict(
|
||||
config_dict, _ = PreTrainedConfig.get_config_dict(
|
||||
model,
|
||||
revision=revision,
|
||||
token=hf_token,
|
||||
@@ -840,9 +840,9 @@ def get_config(
|
||||
code_revision: str | None = None,
|
||||
config_format: str | ConfigFormat = "auto",
|
||||
hf_overrides_kw: dict[str, Any] | None = None,
|
||||
hf_overrides_fn: Callable[[PretrainedConfig], PretrainedConfig] | None = None,
|
||||
hf_overrides_fn: Callable[[PreTrainedConfig], PreTrainedConfig] | None = None,
|
||||
**kwargs,
|
||||
) -> PretrainedConfig:
|
||||
) -> PreTrainedConfig:
|
||||
if config_format == "auto":
|
||||
try:
|
||||
# First check for Mistral to avoid defaulting to
|
||||
@@ -953,7 +953,7 @@ def get_config(
|
||||
# Exhaustively patch RoPE parameters everywhere they might be
|
||||
patch_rope_parameters(config)
|
||||
patch_rope_parameters(config.get_text_config())
|
||||
SubConfigs: TypeAlias = dict[str, PretrainedConfig]
|
||||
SubConfigs: TypeAlias = dict[str, PreTrainedConfig]
|
||||
sub_configs: SubConfigs | None = getattr(config, "sub_configs", None)
|
||||
if sub_configs:
|
||||
for sub_config in sub_configs:
|
||||
@@ -1212,7 +1212,7 @@ def get_hf_image_processor_config(
|
||||
)
|
||||
|
||||
|
||||
def get_hf_text_config(config: PretrainedConfig):
|
||||
def get_hf_text_config(config: PreTrainedConfig):
|
||||
"""Get the "sub" config relevant to llm for multi modal models.
|
||||
No op for pure text models.
|
||||
"""
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class ConfigParserBase(ABC):
|
||||
@@ -16,5 +16,5 @@ class ConfigParserBase(ABC):
|
||||
revision: str | None = None,
|
||||
code_revision: str | None = None,
|
||||
**kwargs,
|
||||
) -> tuple[dict, PretrainedConfig]:
|
||||
) -> tuple[dict, PreTrainedConfig]:
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class AXK1Config(PretrainedConfig):
|
||||
class AXK1Config(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a [`AXK1Model`].
|
||||
It is used to instantiate an A.X model according to the specified arguments,
|
||||
defining the model architecture. Instantiating a configuration with the defaults
|
||||
will yield a similar configuration to that of the A.X K1.
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control
|
||||
the model outputs. Read the documentation from [`PretrainedConfig`] for more
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control
|
||||
the model outputs. Read the documentation from [`PreTrainedConfig`] for more
|
||||
information.
|
||||
|
||||
Args:
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class AfmoeConfig(PretrainedConfig):
|
||||
class AfmoeConfig(PreTrainedConfig):
|
||||
model_type = "afmoe"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from transformers import PretrainedConfig, SiglipVisionConfig
|
||||
from transformers import PreTrainedConfig, SiglipVisionConfig
|
||||
from transformers.models.qwen2 import Qwen2Config
|
||||
|
||||
|
||||
class BagelConfig(PretrainedConfig):
|
||||
class BagelConfig(PreTrainedConfig):
|
||||
"""Configuration class for BAGEL model."""
|
||||
|
||||
model_type = "bagel"
|
||||
|
||||
@@ -9,11 +9,11 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
def _normalize_mrope_parameters(
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
mrope_section: list[int],
|
||||
) -> None:
|
||||
"""Add the top-level Bailing M-RoPE split to a text config."""
|
||||
@@ -50,7 +50,7 @@ def _build_layer_types(
|
||||
]
|
||||
|
||||
|
||||
class BailingMoeV3TextConfig(PretrainedConfig):
|
||||
class BailingMoeV3TextConfig(PreTrainedConfig):
|
||||
model_type = "bailing_hybrid"
|
||||
base_config_key = "text_config"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
@@ -230,7 +230,7 @@ class BailingMoeV3TextConfig(PretrainedConfig):
|
||||
self.validate_layer_type()
|
||||
|
||||
|
||||
class BailingMoeV3VisionConfig(PretrainedConfig):
|
||||
class BailingMoeV3VisionConfig(PreTrainedConfig):
|
||||
model_type = "qwen3_moe_vit"
|
||||
base_config_key = "vision_config"
|
||||
|
||||
@@ -273,7 +273,7 @@ class BailingMoeV3VisionConfig(PretrainedConfig):
|
||||
self.initializer_range = initializer_range
|
||||
|
||||
|
||||
class BailingMoeV3VLConfig(PretrainedConfig):
|
||||
class BailingMoeV3VLConfig(PreTrainedConfig):
|
||||
model_type = "bailing_moe_v3_vl"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
sub_configs = {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
# Adapted from
|
||||
# https://github.com/zai-org/ChatGLM2-6B
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class ChatGLMConfig(PretrainedConfig):
|
||||
class ChatGLMConfig(PreTrainedConfig):
|
||||
model_type = "chatglm"
|
||||
attribute_map = {
|
||||
"num_hidden_layers": "num_layers",
|
||||
|
||||
@@ -8,10 +8,10 @@ with a pixel shuffle connector and ColBERT-style 128-dim per-token embeddings.
|
||||
Reference: https://huggingface.co/ModernVBERT/colmodernvbert-merged
|
||||
"""
|
||||
|
||||
from transformers import ModernBertConfig, PretrainedConfig, SiglipVisionConfig
|
||||
from transformers import ModernBertConfig, PreTrainedConfig, SiglipVisionConfig
|
||||
|
||||
|
||||
class ColModernVBertConfig(PretrainedConfig):
|
||||
class ColModernVBertConfig(PreTrainedConfig):
|
||||
model_type = "colmodernvbert"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.models.siglip2.configuration_siglip2 import Siglip2VisionConfig
|
||||
|
||||
from .nemotron_h import NemotronHConfig
|
||||
@@ -50,7 +50,7 @@ class Cosmos3EdgeTextConfig(NemotronHConfig):
|
||||
return config_dict
|
||||
|
||||
|
||||
class Cosmos3EdgeProjectorConfig(PretrainedConfig):
|
||||
class Cosmos3EdgeProjectorConfig(PreTrainedConfig):
|
||||
model_type = "cosmos3_edge_projector"
|
||||
|
||||
def __init__(
|
||||
@@ -74,7 +74,7 @@ class Cosmos3EdgeVisionConfig(Siglip2VisionConfig):
|
||||
model_type = "cosmos3_edge_vision"
|
||||
|
||||
|
||||
class Cosmos3EdgeConfig(PretrainedConfig):
|
||||
class Cosmos3EdgeConfig(PreTrainedConfig):
|
||||
model_type = "cosmos3_edge"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
has_no_defaults_at_init = True
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class DeepseekV4Config(PretrainedConfig):
|
||||
class DeepseekV4Config(PreTrainedConfig):
|
||||
model_type = "deepseek_v4"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class DeepseekV41Config(PretrainedConfig):
|
||||
class DeepseekV41Config(PreTrainedConfig):
|
||||
"""DeepSeek V4.1 config.
|
||||
|
||||
The HF config nests the text model under ``text_config`` and the vision
|
||||
@@ -34,7 +34,7 @@ class DeepseekV41Config(PretrainedConfig):
|
||||
for key, value in text_config.items():
|
||||
if key == "model_type":
|
||||
continue
|
||||
# Don't clobber PretrainedConfig properties (e.g. is_encoder_decoder).
|
||||
# Don't clobber PreTrainedConfig properties (e.g. is_encoder_decoder).
|
||||
if isinstance(getattr(type(self), key, None), property):
|
||||
continue
|
||||
setattr(self, key, value)
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
# adapted from https://github.com/deepseek-ai/DeepSeek-VL2/blob/faf18023f24b962b32d9f0a2d89e402a8d383a78/deepseek_vl2/models/modeling_deepseek_vl_v2.py#L115-L268
|
||||
|
||||
from huggingface_hub.dataclasses import strict
|
||||
from transformers import DeepseekV2Config, PretrainedConfig
|
||||
from transformers import DeepseekV2Config, PreTrainedConfig
|
||||
|
||||
|
||||
class VisionEncoderConfig(PretrainedConfig):
|
||||
class VisionEncoderConfig(PreTrainedConfig):
|
||||
model_type: str = "vision"
|
||||
|
||||
model_name: str = "vit_so400m_patch14_siglip_384.webli"
|
||||
@@ -58,7 +58,7 @@ class VisionEncoderConfig(PretrainedConfig):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class MlpProjectorConfig(PretrainedConfig):
|
||||
class MlpProjectorConfig(PreTrainedConfig):
|
||||
model_type = "mlp_projector"
|
||||
projector_type: str = "downsample_mlp_gelu"
|
||||
input_dim: int = 1152
|
||||
@@ -98,7 +98,7 @@ class DeepseekVLV2TextConfig(DeepseekV2Config):
|
||||
kv_lora_rank: int | None = DeepseekV2Config.kv_lora_rank
|
||||
|
||||
|
||||
class DeepseekVLV2Config(PretrainedConfig):
|
||||
class DeepseekVLV2Config(PreTrainedConfig):
|
||||
model_type = "deepseek_vl_v2"
|
||||
|
||||
tile_tag: str = "2D"
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
from transformers.models.gemma4.configuration_gemma4 import Gemma4VisionConfig
|
||||
|
||||
|
||||
def _init_text_config(self: PretrainedConfig, **kwargs: Any) -> None:
|
||||
PretrainedConfig.__init__(self, **kwargs)
|
||||
def _init_text_config(self: PreTrainedConfig, **kwargs: Any) -> None:
|
||||
PreTrainedConfig.__init__(self, **kwargs)
|
||||
# DiffusionGemma always uses MoE and K=V sharing for full_attention
|
||||
# layers. The HF reference removed these config fields entirely.
|
||||
if getattr(self, "num_experts", None):
|
||||
@@ -15,14 +15,14 @@ def _init_text_config(self: PretrainedConfig, **kwargs: Any) -> None:
|
||||
self.attention_k_eq_v = True
|
||||
|
||||
|
||||
class DiffusionGemmaTextConfig(PretrainedConfig):
|
||||
class DiffusionGemmaTextConfig(PreTrainedConfig):
|
||||
model_type = "diffusion_gemma_text"
|
||||
|
||||
def __init__(self, **kwargs: Any):
|
||||
_init_text_config(self, **kwargs)
|
||||
|
||||
|
||||
class DiffusionGemmaConfig(PretrainedConfig):
|
||||
class DiffusionGemmaConfig(PreTrainedConfig):
|
||||
model_type = "diffusion_gemma"
|
||||
|
||||
def __init__(
|
||||
@@ -41,4 +41,4 @@ class DiffusionGemmaConfig(PretrainedConfig):
|
||||
else:
|
||||
self.vision_config = vision_config
|
||||
self.audio_config = None
|
||||
PretrainedConfig.__init__(self, **kwargs)
|
||||
PreTrainedConfig.__init__(self, **kwargs)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.models.qwen2 import Qwen2Config
|
||||
|
||||
|
||||
class DotsVisionConfig(PretrainedConfig):
|
||||
class DotsVisionConfig(PreTrainedConfig):
|
||||
model_type: str = "dots_vit"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -3,22 +3,22 @@
|
||||
|
||||
import os
|
||||
|
||||
from transformers import AutoConfig, DeepseekV2Config, PretrainedConfig
|
||||
from transformers import AutoConfig, DeepseekV2Config, PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.utils import without_trust_remote_code
|
||||
|
||||
|
||||
class EAGLEConfig(PretrainedConfig):
|
||||
class EAGLEConfig(PreTrainedConfig):
|
||||
model_type = "eagle"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
model: PretrainedConfig | dict | None = None,
|
||||
model: PreTrainedConfig | dict | None = None,
|
||||
truncated_vocab_size: int | None = None,
|
||||
method: str | None = "eagle",
|
||||
**kwargs,
|
||||
):
|
||||
model_config: PretrainedConfig | DeepseekV2Config | None
|
||||
model_config: PreTrainedConfig | DeepseekV2Config | None
|
||||
if isinstance(model, dict):
|
||||
model_config = AutoConfig.for_model(**model)
|
||||
else:
|
||||
|
||||
@@ -5,17 +5,17 @@ the extract_hidden_states spec decoding method."""
|
||||
|
||||
import os
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.utils import without_trust_remote_code
|
||||
|
||||
|
||||
class ExtractHiddenStatesConfig(PretrainedConfig):
|
||||
class ExtractHiddenStatesConfig(PreTrainedConfig):
|
||||
model_type = "extract_hidden_states"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
model: PretrainedConfig | dict | None = None,
|
||||
model: PreTrainedConfig | dict | None = None,
|
||||
method: str | None = "extract_hidden_states",
|
||||
**kwargs,
|
||||
):
|
||||
@@ -24,7 +24,7 @@ class ExtractHiddenStatesConfig(PretrainedConfig):
|
||||
if isinstance(model, dict):
|
||||
model_dict = model
|
||||
source_text_config = None
|
||||
elif isinstance(model, PretrainedConfig):
|
||||
elif isinstance(model, PreTrainedConfig):
|
||||
model_dict = model.to_dict()
|
||||
text_config = model.get_text_config()
|
||||
source_text_config = text_config if text_config is not model else None
|
||||
@@ -40,7 +40,7 @@ class ExtractHiddenStatesConfig(PretrainedConfig):
|
||||
combined["architectures"] = ["ExtractHiddenStatesModel"]
|
||||
|
||||
# to_dict() and kwargs both flatten text_config to a plain dict;
|
||||
# downstream get_hf_text_config() needs it as a PretrainedConfig
|
||||
# downstream get_hf_text_config() needs it as a PreTrainedConfig
|
||||
# for attribute access. Re-insert the original object.
|
||||
if source_text_config is not None:
|
||||
combined["text_config"] = source_text_config
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
# limitations under the License.
|
||||
"""Falcon configuration."""
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class RWConfig(PretrainedConfig):
|
||||
class RWConfig(PreTrainedConfig):
|
||||
model_type = "falcon"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
attribute_map = {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from transformers import CONFIG_MAPPING, PretrainedConfig
|
||||
from transformers import CONFIG_MAPPING, PreTrainedConfig
|
||||
|
||||
# NOTE: Temporary shim for FunAudioChat checkpoints.
|
||||
# These checkpoints use `model_type="funaudiochat"`, which is not currently
|
||||
@@ -13,7 +13,7 @@ from transformers import CONFIG_MAPPING, PretrainedConfig
|
||||
# provides an `auto_map`) and vLLM can rely on `AutoConfig.from_pretrained()`.
|
||||
|
||||
|
||||
class FunAudioChatAudioEncoderConfig(PretrainedConfig):
|
||||
class FunAudioChatAudioEncoderConfig(PreTrainedConfig):
|
||||
model_type = "funaudiochat_audio_encoder"
|
||||
|
||||
def __init__(
|
||||
@@ -74,7 +74,7 @@ class FunAudioChatAudioEncoderConfig(PretrainedConfig):
|
||||
self.pad_token_id = pad_token_id
|
||||
|
||||
|
||||
class FunAudioChatConfig(PretrainedConfig):
|
||||
class FunAudioChatConfig(PreTrainedConfig):
|
||||
model_type = "funaudiochat"
|
||||
attribute_map = {
|
||||
"audio_token_id": "audio_token_index",
|
||||
@@ -82,8 +82,8 @@ class FunAudioChatConfig(PretrainedConfig):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
audio_config: PretrainedConfig | dict | None = None,
|
||||
text_config: PretrainedConfig | dict | None = None,
|
||||
audio_config: PreTrainedConfig | dict | None = None,
|
||||
text_config: PreTrainedConfig | dict | None = None,
|
||||
audio_token_index: int = 151646,
|
||||
ignore_index: int = -100,
|
||||
hidden_size: int | None = None,
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
from copy import copy
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
def gemma4_layer_config(
|
||||
text_config: PretrainedConfig, layer_idx: int
|
||||
) -> PretrainedConfig:
|
||||
text_config: PreTrainedConfig, layer_idx: int
|
||||
) -> PreTrainedConfig:
|
||||
"""The Gemma4 text config as it applies to one layer.
|
||||
|
||||
Gemma4 uses a larger head dimension on its full attention layers than on its
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
from vllm.logger import init_logger
|
||||
|
||||
logger = init_logger(__name__)
|
||||
|
||||
|
||||
class Glm5NextTextConfig(PretrainedConfig):
|
||||
class Glm5NextTextConfig(PreTrainedConfig):
|
||||
model_type = "glm5_next_text"
|
||||
base_config_key = "text_config"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
@@ -271,7 +271,7 @@ class Glm5NextTextConfig(PretrainedConfig):
|
||||
]
|
||||
|
||||
|
||||
class Glm5NextVisionConfig(PretrainedConfig):
|
||||
class Glm5NextVisionConfig(PreTrainedConfig):
|
||||
model_type = "glm5_next_vision"
|
||||
base_config_key = "vision_config"
|
||||
|
||||
@@ -324,7 +324,7 @@ class Glm5NextVisionConfig(PretrainedConfig):
|
||||
self.swiglu_limit = swiglu_limit
|
||||
|
||||
|
||||
class Glm5NextConfig(PretrainedConfig):
|
||||
class Glm5NextConfig(PreTrainedConfig):
|
||||
model_type = "glm5_next"
|
||||
sub_configs = {
|
||||
"vision_config": Glm5NextVisionConfig,
|
||||
@@ -345,7 +345,7 @@ class Glm5NextConfig(PretrainedConfig):
|
||||
**kwargs,
|
||||
):
|
||||
# Init super() first so base-class defaults don't clobber text-config
|
||||
# values set below (PretrainedConfig has many text-related defaults
|
||||
# values set below (PreTrainedConfig has many text-related defaults
|
||||
# that differ from Glm5NextTextConfig).
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@@ -379,7 +379,7 @@ class Glm5NextConfig(PretrainedConfig):
|
||||
# and must NOT be mirrored onto text_config: ``architectures`` /
|
||||
# ``torch_dtype`` differ between the top-level config and the text
|
||||
# sub-config, and mirroring them makes the top-level ``architectures``
|
||||
# silently read back as None (PretrainedConfig initializes both to None),
|
||||
# silently read back as None (PreTrainedConfig initializes both to None),
|
||||
# which then fails model-class resolution ("No model architectures are
|
||||
# specified").
|
||||
_UNMIRRORED_KEYS = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from typing import Any
|
||||
import transformers
|
||||
|
||||
|
||||
class Granite4VisionConfig(transformers.PretrainedConfig):
|
||||
class Granite4VisionConfig(transformers.PreTrainedConfig):
|
||||
"""Configuration for Granite 4 Vision model.
|
||||
|
||||
This config is needed because the granite4_vision model type is not yet
|
||||
@@ -81,7 +81,7 @@ class Granite4VisionConfig(transformers.PretrainedConfig):
|
||||
**vision_config
|
||||
)
|
||||
else:
|
||||
self.vision_config = transformers.PretrainedConfig(**vision_config)
|
||||
self.vision_config = transformers.PreTrainedConfig(**vision_config)
|
||||
|
||||
text_model_type = text_config.get("model_type", "granite")
|
||||
if text_model_type in transformers.CONFIG_MAPPING:
|
||||
@@ -89,6 +89,6 @@ class Granite4VisionConfig(transformers.PretrainedConfig):
|
||||
**text_config
|
||||
)
|
||||
else:
|
||||
self.text_config = transformers.PretrainedConfig(**text_config)
|
||||
self.text_config = transformers.PreTrainedConfig(**text_config)
|
||||
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class HYV3Config(PretrainedConfig):
|
||||
class HYV3Config(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a [`HYV3Model`].
|
||||
It is used to instantiate a HYV3 model (HY V3 MoE language model) according to
|
||||
the specified arguments.
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to
|
||||
control the model outputs. Read the documentation from [`PretrainedConfig`]
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to
|
||||
control the model outputs. Read the documentation from [`PreTrainedConfig`]
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
|
||||
@@ -17,16 +17,16 @@
|
||||
# limitations under the License.
|
||||
"""HyperCLOVA X model configuration."""
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class HyperCLOVAXConfig(PretrainedConfig):
|
||||
class HyperCLOVAXConfig(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a
|
||||
[`HyperCLOVAXModel`]. It is used to instantiate a HyperCLOVAX model
|
||||
according to the specified arguments, defining the model architecture.
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used
|
||||
to control the model outputs. Read the documentation from
|
||||
[`PretrainedConfig`] for more information.
|
||||
[`PreTrainedConfig`] for more information.
|
||||
|
||||
Args:
|
||||
vocab_size (`int`, *optional*, defaults to 32000):
|
||||
|
||||
@@ -7,10 +7,10 @@ A video-chunk is the smallest independently processable unit of video.
|
||||
"""
|
||||
|
||||
from transformers import DeepseekV3Config
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class KimiK25VisionConfig(PretrainedConfig):
|
||||
class KimiK25VisionConfig(PreTrainedConfig):
|
||||
model_type = "kimi_k25_vision"
|
||||
|
||||
def __init__(
|
||||
@@ -59,7 +59,7 @@ class KimiK25VisionConfig(PretrainedConfig):
|
||||
self.projector_ln_eps = projector_ln_eps
|
||||
|
||||
|
||||
class KimiK25Config(PretrainedConfig):
|
||||
class KimiK25Config(PreTrainedConfig):
|
||||
"""Kimi-K2.5 model configuration.
|
||||
|
||||
Kimi-K2.5 extends Kimi-K2 with vision support using video-chunks.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""Kimi-K3 multimodal configuration."""
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
from vllm.logger import init_logger
|
||||
from vllm.transformers_utils.configs.kimi_linear import KimiLinearConfig
|
||||
@@ -10,7 +10,7 @@ from vllm.transformers_utils.configs.kimi_linear import KimiLinearConfig
|
||||
logger = init_logger(__name__)
|
||||
|
||||
|
||||
class KimiK3VisionConfig(PretrainedConfig):
|
||||
class KimiK3VisionConfig(PreTrainedConfig):
|
||||
model_type = "kimi_k3_vision"
|
||||
|
||||
def __init__(
|
||||
@@ -83,7 +83,7 @@ class KimiK3VisionConfig(PretrainedConfig):
|
||||
self.intermediate_size = vt_intermediate_size
|
||||
|
||||
|
||||
class KimiK3Config(PretrainedConfig):
|
||||
class KimiK3Config(PreTrainedConfig):
|
||||
model_type = "kimi_k3"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class KimiLinearConfig(PretrainedConfig):
|
||||
class KimiLinearConfig(PreTrainedConfig):
|
||||
model_type = "kimi_linear"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
# Adapted from https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/blob/main/configuration_kimi_vl.py
|
||||
|
||||
from transformers import DeepseekV2Config
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.configs.moonvit import MoonViTConfig
|
||||
|
||||
|
||||
class KimiVLConfig(PretrainedConfig):
|
||||
class KimiVLConfig(PreTrainedConfig):
|
||||
model_type = "kimi_vl"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class Lfm2MoeConfig(PretrainedConfig):
|
||||
class Lfm2MoeConfig(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a [`Lfm2MoeModel`]. It is used to instantiate a LFM2 Moe
|
||||
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
||||
defaults will yield a similar configuration to that of the LFM2-8B-A1B model.
|
||||
e.g. [LiquidAI/LFM2-8B-A1B](https://huggingface.co/LiquidAI/LFM2-8B-A1B)
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PretrainedConfig`] for more information.
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PreTrainedConfig`] for more information.
|
||||
|
||||
|
||||
Args:
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
import os
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.utils import without_trust_remote_code
|
||||
|
||||
|
||||
class MedusaConfig(PretrainedConfig):
|
||||
class MedusaConfig(PreTrainedConfig):
|
||||
model_type = "medusa"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
from transformers.models.qwen2_5_omni.configuration_qwen2_5_omni import (
|
||||
Qwen2_5OmniTextConfig,
|
||||
)
|
||||
|
||||
|
||||
class DashengConfig(PretrainedConfig):
|
||||
class DashengConfig(PreTrainedConfig):
|
||||
model_type = "midashenglm_dasheng_encoder"
|
||||
|
||||
def __init__(
|
||||
@@ -80,7 +80,7 @@ class DashengConfig(PretrainedConfig):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class MiDashengLMConfig(PretrainedConfig):
|
||||
class MiDashengLMConfig(PreTrainedConfig):
|
||||
model_type = "midashenglm"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class Mimo_VLVisionConfig(PretrainedConfig):
|
||||
class Mimo_VLVisionConfig(PreTrainedConfig):
|
||||
model_type = "mimovl"
|
||||
base_config_key = "vision_config"
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class MiniMaxM3TextConfig(PretrainedConfig):
|
||||
class MiniMaxM3TextConfig(PreTrainedConfig):
|
||||
"""Config for the MiniMax M3 text backbone (MiniMaxM3SparseForCausalLM).
|
||||
|
||||
Defaults mirror the ``text_config`` of the MiniMax-M3-preview checkpoint.
|
||||
@@ -120,7 +120,7 @@ class MiniMaxM3MTPConfig(MiniMaxM3TextConfig):
|
||||
super().__init__(num_hidden_layers=num_hidden_layers, **kwargs)
|
||||
|
||||
|
||||
class MiniMaxM3Config(PretrainedConfig):
|
||||
class MiniMaxM3Config(PreTrainedConfig):
|
||||
"""Top-level MiniMax M3 (VL) config.
|
||||
|
||||
Holds the text backbone as ``text_config`` so that
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig, WhisperConfig
|
||||
from transformers import PreTrainedConfig, WhisperConfig
|
||||
|
||||
from vllm.logger import init_logger
|
||||
|
||||
@@ -12,7 +12,7 @@ logger = init_logger(__name__)
|
||||
def adapt_config_dict(
|
||||
config_dict: dict[str, Any],
|
||||
defaults: dict[str, Any],
|
||||
) -> PretrainedConfig:
|
||||
) -> PreTrainedConfig:
|
||||
config_dict = _remap_general_mistral_args(config_dict)
|
||||
config_dict = _remap_mistral_sliding_window(config_dict)
|
||||
|
||||
@@ -86,7 +86,7 @@ def adapt_config_dict(
|
||||
for k, v in defaults.items():
|
||||
config_dict.setdefault(k, v)
|
||||
|
||||
config = PretrainedConfig.from_dict(config_dict)
|
||||
config = PreTrainedConfig.from_dict(config_dict)
|
||||
|
||||
logger.debug("Initialized config %s", config)
|
||||
|
||||
@@ -103,8 +103,8 @@ def _remap_mistral_vision_args(config: dict) -> dict:
|
||||
config = {
|
||||
"model_type": "pixtral",
|
||||
"architectures": ["PixtralForConditionalGeneration"],
|
||||
"text_config": PretrainedConfig.from_dict(config),
|
||||
"vision_config": PretrainedConfig.from_dict(vision_config),
|
||||
"text_config": PreTrainedConfig.from_dict(config),
|
||||
"vision_config": PreTrainedConfig.from_dict(vision_config),
|
||||
}
|
||||
if quant_config:
|
||||
config["quantization_config"] = quant_config
|
||||
@@ -248,7 +248,7 @@ def _remap_mistral_audio_args(config: dict) -> dict:
|
||||
config = {
|
||||
"model_type": "voxtral",
|
||||
"architectures": [architecture],
|
||||
"text_config": PretrainedConfig.from_dict(config),
|
||||
"text_config": PreTrainedConfig.from_dict(config),
|
||||
"audio_config": WhisperConfig(
|
||||
num_mel_bins=encoder_args["audio_encoding_args"]["num_mel_bins"],
|
||||
window_size=encoder_args["audio_encoding_args"]["window_size"],
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class MLPSpeculatorConfig(PretrainedConfig):
|
||||
class MLPSpeculatorConfig(PreTrainedConfig):
|
||||
model_type = "mlp_speculator"
|
||||
|
||||
attribute_map = {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""Configuration for Moondream3 model."""
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
|
||||
class Moondream3VisionConfig(PretrainedConfig):
|
||||
class Moondream3VisionConfig(PreTrainedConfig):
|
||||
"""Vision encoder configuration for Moondream3."""
|
||||
|
||||
model_type = "moondream3_vision"
|
||||
@@ -43,7 +43,7 @@ class Moondream3VisionConfig(PretrainedConfig):
|
||||
self.image_size = crop_size
|
||||
|
||||
|
||||
class Moondream3TextConfig(PretrainedConfig):
|
||||
class Moondream3TextConfig(PreTrainedConfig):
|
||||
"""Text decoder configuration for Moondream3."""
|
||||
|
||||
model_type = "moondream3_text"
|
||||
@@ -101,7 +101,7 @@ class Moondream3TextConfig(PretrainedConfig):
|
||||
self.num_experts_per_tok = self.moe_experts_per_token
|
||||
|
||||
|
||||
class Moondream3Config(PretrainedConfig):
|
||||
class Moondream3Config(PreTrainedConfig):
|
||||
"""Combined configuration for Moondream3 multimodal model."""
|
||||
|
||||
model_type = "moondream3"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
# Adapted from https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/blob/main/configuration_kimi_vl.py
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class MoonViTConfig(PretrainedConfig):
|
||||
class MoonViTConfig(PreTrainedConfig):
|
||||
model_type = "moonvit"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig, Qwen3Config
|
||||
from transformers import PreTrainedConfig, Qwen3Config
|
||||
from transformers.models.whisper.configuration_whisper import WhisperConfig
|
||||
|
||||
|
||||
class MossTranscribeDiarizeConfig(PretrainedConfig):
|
||||
class MossTranscribeDiarizeConfig(PreTrainedConfig):
|
||||
"""Configuration for MOSS-Transcribe-Diarize."""
|
||||
|
||||
model_type = "moss_transcribe_diarize"
|
||||
|
||||
@@ -15,7 +15,7 @@ and vision configs are consumed by the native multimodal serving path.
|
||||
from __future__ import annotations
|
||||
|
||||
from transformers import Qwen3Config
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
def _default_no_rope_layers(num_hidden_layers: int) -> list[int]:
|
||||
@@ -27,7 +27,7 @@ def _default_no_rope_layers(num_hidden_layers: int) -> list[int]:
|
||||
]
|
||||
|
||||
|
||||
class MuseGlimmerTextConfig(PretrainedConfig):
|
||||
class MuseGlimmerTextConfig(PreTrainedConfig):
|
||||
model_type = "muse_glimmer_text"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
|
||||
@@ -127,7 +127,7 @@ class MuseGlimmerTextConfig(PretrainedConfig):
|
||||
)
|
||||
|
||||
|
||||
class MuseGlimmerVisionConfig(PretrainedConfig):
|
||||
class MuseGlimmerVisionConfig(PreTrainedConfig):
|
||||
model_type = "muse_glimmer_vision"
|
||||
|
||||
def __init__(
|
||||
@@ -177,7 +177,7 @@ class MuseGlimmerVisionConfig(PretrainedConfig):
|
||||
self.layer_types = layer_types
|
||||
|
||||
|
||||
class MuseGlimmerConfig(PretrainedConfig):
|
||||
class MuseGlimmerConfig(PreTrainedConfig):
|
||||
model_type = "muse_glimmer"
|
||||
sub_configs = {
|
||||
"text_config": MuseGlimmerTextConfig,
|
||||
|
||||
@@ -17,22 +17,22 @@
|
||||
# limitations under the License.
|
||||
"""Nemotron model configuration."""
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
from transformers.utils import logging
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
|
||||
|
||||
class NemotronConfig(PretrainedConfig):
|
||||
class NemotronConfig(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a
|
||||
[`NemotronModel`]. It is used to instantiate a Nemotron model
|
||||
according to the specified arguments, defining the model architecture.
|
||||
Instantiating a configuration with the defaults will yield a similar
|
||||
configuration to that of the Nemotron-8B.
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be
|
||||
used to control the model outputs. Read the documentation from
|
||||
[`PretrainedConfig`] for more information.
|
||||
[`PreTrainedConfig`] for more information.
|
||||
|
||||
|
||||
Args:
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
"""NemotronH model configuration."""
|
||||
|
||||
import regex as re
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.utils import logging
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
|
||||
|
||||
class NemotronHConfig(PretrainedConfig):
|
||||
class NemotronHConfig(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a
|
||||
[`NemotronHModel`]. It is used to instantiate a NemotronH model according
|
||||
to the specified arguments, defining the model architecture. Instantiating
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class OlmoHybridConfig(PretrainedConfig):
|
||||
class OlmoHybridConfig(PreTrainedConfig):
|
||||
r"""Configuration class for [`OlmoHybridModel`]. It is used to
|
||||
instantiate an OLMo Hybrid model according to the specified
|
||||
arguments, defining the model architecture. Instantiating a
|
||||
|
||||
@@ -9,10 +9,10 @@ configuration without executing Hugging Face remote code.
|
||||
|
||||
from typing import Any
|
||||
|
||||
from transformers import LlamaConfig, PretrainedConfig
|
||||
from transformers import LlamaConfig, PreTrainedConfig
|
||||
|
||||
|
||||
class OpenVLAConfig(PretrainedConfig):
|
||||
class OpenVLAConfig(PreTrainedConfig):
|
||||
"""Configuration class for OpenVLA models."""
|
||||
|
||||
model_type = "openvla"
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
# Ovis Config with AimV2 config registration removed for Transformers compatibility
|
||||
from typing import Any
|
||||
|
||||
from transformers import AutoConfig, PretrainedConfig
|
||||
from transformers import AutoConfig, PreTrainedConfig
|
||||
|
||||
|
||||
class AIMv2Config(PretrainedConfig):
|
||||
class AIMv2Config(PreTrainedConfig):
|
||||
"""This is the configuration class to store the configuration of an [`AIMv2Model`].
|
||||
Instantiating a configuration with the defaults will yield a similar configuration
|
||||
to that of the [apple/aimv2-large-patch14-224](https://huggingface.co/apple/aimv2-large-patch14-224).
|
||||
@@ -29,7 +29,7 @@ class AIMv2Config(PretrainedConfig):
|
||||
projection_dropout: Dropout ratio for the projection layer after the attention.
|
||||
qkv_bias: Whether to add a bias to the queries, keys and values.
|
||||
use_bias: Whether to add a bias in the feed-forward and projection layers.
|
||||
kwargs: Keyword arguments for the [`PretrainedConfig`].
|
||||
kwargs: Keyword arguments for the [`PreTrainedConfig`].
|
||||
|
||||
"""
|
||||
|
||||
@@ -70,7 +70,7 @@ class AIMv2Config(PretrainedConfig):
|
||||
# ----------------------------------------------------------------------
|
||||
# Visual Tokenizer Configuration
|
||||
# ----------------------------------------------------------------------
|
||||
class BaseVisualTokenizerConfig(PretrainedConfig):
|
||||
class BaseVisualTokenizerConfig(PreTrainedConfig):
|
||||
def __init__(
|
||||
self,
|
||||
vocab_size=16384,
|
||||
@@ -78,7 +78,7 @@ class BaseVisualTokenizerConfig(PretrainedConfig):
|
||||
tau=1.0,
|
||||
depths=None,
|
||||
drop_cls_token=False,
|
||||
backbone_config: PretrainedConfig | dict | None = None,
|
||||
backbone_config: PreTrainedConfig | dict | None = None,
|
||||
hidden_stride: int = 1,
|
||||
**kwargs,
|
||||
):
|
||||
@@ -92,10 +92,10 @@ class BaseVisualTokenizerConfig(PretrainedConfig):
|
||||
self.backbone_kwargs = dict[str, Any]()
|
||||
self.drop_cls_token = drop_cls_token
|
||||
if backbone_config is not None:
|
||||
assert isinstance(backbone_config, (PretrainedConfig, dict)), (
|
||||
f"expect `backbone_config` to be instance of PretrainedConfig or dict, but got {type(backbone_config)} type"
|
||||
assert isinstance(backbone_config, (PreTrainedConfig, dict)), (
|
||||
f"expect `backbone_config` to be instance of PreTrainedConfig or dict, but got {type(backbone_config)} type"
|
||||
)
|
||||
if not isinstance(backbone_config, PretrainedConfig):
|
||||
if not isinstance(backbone_config, PreTrainedConfig):
|
||||
model_type = backbone_config["model_type"]
|
||||
if model_type != "aimv2":
|
||||
backbone_config.pop("model_type")
|
||||
@@ -139,13 +139,13 @@ AutoConfig.register("aimv2_visual_tokenizer", Aimv2VisualTokenizerConfig)
|
||||
# ----------------------------------------------------------------------
|
||||
# Ovis Configuration
|
||||
# ----------------------------------------------------------------------
|
||||
class OvisConfig(PretrainedConfig):
|
||||
class OvisConfig(PreTrainedConfig):
|
||||
model_type = "ovis"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
llm_config: PretrainedConfig | dict | None = None,
|
||||
visual_tokenizer_config: PretrainedConfig | dict | None = None,
|
||||
llm_config: PreTrainedConfig | dict | None = None,
|
||||
visual_tokenizer_config: PreTrainedConfig | dict | None = None,
|
||||
multimodal_max_length=8192,
|
||||
hidden_size=None,
|
||||
conversation_formatter_class=None,
|
||||
@@ -155,10 +155,10 @@ class OvisConfig(PretrainedConfig):
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
if llm_config is not None:
|
||||
assert isinstance(llm_config, (PretrainedConfig, dict)), (
|
||||
f"expect `llm_config` to be instance of PretrainedConfig or dict, but got {type(llm_config)} type"
|
||||
assert isinstance(llm_config, (PreTrainedConfig, dict)), (
|
||||
f"expect `llm_config` to be instance of PreTrainedConfig or dict, but got {type(llm_config)} type"
|
||||
)
|
||||
if not isinstance(llm_config, PretrainedConfig):
|
||||
if not isinstance(llm_config, PreTrainedConfig):
|
||||
model_type = llm_config["model_type"]
|
||||
llm_config.pop("model_type")
|
||||
llm_config = AutoConfig.for_model(model_type, **llm_config)
|
||||
@@ -166,10 +166,10 @@ class OvisConfig(PretrainedConfig):
|
||||
# map llm_config to text_config
|
||||
self.text_config = llm_config
|
||||
if visual_tokenizer_config is not None:
|
||||
assert isinstance(visual_tokenizer_config, (PretrainedConfig, dict)), (
|
||||
f"expect `visual_tokenizer_config` to be instance of PretrainedConfig or dict, but got {type(visual_tokenizer_config)} type"
|
||||
assert isinstance(visual_tokenizer_config, (PreTrainedConfig, dict)), (
|
||||
f"expect `visual_tokenizer_config` to be instance of PreTrainedConfig or dict, but got {type(visual_tokenizer_config)} type"
|
||||
)
|
||||
if not isinstance(visual_tokenizer_config, PretrainedConfig):
|
||||
if not isinstance(visual_tokenizer_config, PreTrainedConfig):
|
||||
model_type = visual_tokenizer_config["model_type"]
|
||||
visual_tokenizer_config.pop("model_type")
|
||||
visual_tokenizer_config = AutoConfig.for_model(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from dataclasses import dataclass
|
||||
|
||||
from transformers import ParakeetEncoderConfig, PretrainedConfig
|
||||
from transformers import ParakeetEncoderConfig, PreTrainedConfig
|
||||
|
||||
|
||||
class ParakeetConfig(ParakeetEncoderConfig):
|
||||
@@ -24,9 +24,9 @@ class ParakeetConfig(ParakeetEncoderConfig):
|
||||
|
||||
@staticmethod
|
||||
def from_hf_config(
|
||||
config: PretrainedConfig, *, llm_hidden_size: int, max_model_len: int
|
||||
config: PreTrainedConfig, *, llm_hidden_size: int, max_model_len: int
|
||||
) -> "ParakeetConfig":
|
||||
assert isinstance(config, PretrainedConfig)
|
||||
assert isinstance(config, PreTrainedConfig)
|
||||
return ParakeetConfig(
|
||||
**config.to_dict(),
|
||||
scale_input=False,
|
||||
@@ -55,8 +55,8 @@ class ExtractorConfig:
|
||||
padding_value: float = 0.0
|
||||
|
||||
@classmethod
|
||||
def from_hf_config(cls, config: PretrainedConfig) -> "ExtractorConfig":
|
||||
assert isinstance(config, PretrainedConfig)
|
||||
def from_hf_config(cls, config: PreTrainedConfig) -> "ExtractorConfig":
|
||||
assert isinstance(config, PreTrainedConfig)
|
||||
defaults = ("hop_length", "win_length", "preemphasis", "n_fft", "padding_value")
|
||||
optional_kwargs = {
|
||||
name: getattr(config, name) for name in defaults if hasattr(config, name)
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
from transformers.models.auto import CONFIG_MAPPING
|
||||
|
||||
|
||||
class QianfanOCRVisionConfig(PretrainedConfig):
|
||||
class QianfanOCRVisionConfig(PreTrainedConfig):
|
||||
model_type = "qianfan_ocr_vision"
|
||||
|
||||
def __init__(
|
||||
@@ -53,7 +53,7 @@ class QianfanOCRVisionConfig(PretrainedConfig):
|
||||
self.use_mean_pooling = use_mean_pooling
|
||||
|
||||
|
||||
class QianfanOCRConfig(PretrainedConfig):
|
||||
class QianfanOCRConfig(PreTrainedConfig):
|
||||
model_type = "qianfan_ocr"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
# limitations under the License.
|
||||
"""Qwen3.5 model configuration."""
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class Qwen3_5TextConfig(PretrainedConfig):
|
||||
class Qwen3_5TextConfig(PreTrainedConfig):
|
||||
model_type = "qwen3_5_text"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
|
||||
@@ -108,7 +108,7 @@ class Qwen3_5TextConfig(PretrainedConfig):
|
||||
self.linear_num_value_heads = linear_num_value_heads
|
||||
super().__init__(**kwargs)
|
||||
# Set these AFTER super().__init__() because transformers v4's
|
||||
# PretrainedConfig.__init__ has these as explicit params with different
|
||||
# PreTrainedConfig.__init__ has these as explicit params with different
|
||||
# defaults (e.g. tie_word_embeddings=True) that would overwrite our values.
|
||||
self.pad_token_id = pad_token_id
|
||||
self.bos_token_id = bos_token_id
|
||||
@@ -116,7 +116,7 @@ class Qwen3_5TextConfig(PretrainedConfig):
|
||||
self.tie_word_embeddings = tie_word_embeddings
|
||||
|
||||
|
||||
class Qwen3_5VisionConfig(PretrainedConfig):
|
||||
class Qwen3_5VisionConfig(PreTrainedConfig):
|
||||
model_type = "qwen3_5"
|
||||
base_config_key = "vision_config"
|
||||
|
||||
@@ -152,7 +152,7 @@ class Qwen3_5VisionConfig(PretrainedConfig):
|
||||
self.initializer_range = initializer_range
|
||||
|
||||
|
||||
class Qwen3_5Config(PretrainedConfig):
|
||||
class Qwen3_5Config(PreTrainedConfig):
|
||||
model_type = "qwen3_5"
|
||||
sub_configs = {
|
||||
"vision_config": Qwen3_5VisionConfig,
|
||||
@@ -186,7 +186,7 @@ class Qwen3_5Config(PretrainedConfig):
|
||||
self.vision_start_token_id = vision_start_token_id
|
||||
self.vision_end_token_id = vision_end_token_id
|
||||
super().__init__(**kwargs)
|
||||
# Set after super().__init__() to avoid v4 PretrainedConfig overwrite
|
||||
# Set after super().__init__() to avoid v4 PreTrainedConfig overwrite
|
||||
self.tie_word_embeddings = tie_word_embeddings
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
# limitations under the License.
|
||||
"""Qwen3.5-MoE model configuration."""
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class Qwen3_5MoeTextConfig(PretrainedConfig):
|
||||
class Qwen3_5MoeTextConfig(PreTrainedConfig):
|
||||
model_type = "qwen3_5_moe_text"
|
||||
keys_to_ignore_at_inference = ["past_key_values"]
|
||||
|
||||
@@ -120,7 +120,7 @@ class Qwen3_5MoeTextConfig(PretrainedConfig):
|
||||
self.router_aux_loss_coef = router_aux_loss_coef
|
||||
super().__init__(**kwargs)
|
||||
# Set these AFTER super().__init__() because transformers v4's
|
||||
# PretrainedConfig.__init__ has these as explicit params with different
|
||||
# PreTrainedConfig.__init__ has these as explicit params with different
|
||||
# defaults (e.g. tie_word_embeddings=True) that would overwrite our values.
|
||||
self.pad_token_id = pad_token_id
|
||||
self.bos_token_id = bos_token_id
|
||||
@@ -128,7 +128,7 @@ class Qwen3_5MoeTextConfig(PretrainedConfig):
|
||||
self.tie_word_embeddings = tie_word_embeddings
|
||||
|
||||
|
||||
class Qwen3_5MoeVisionConfig(PretrainedConfig):
|
||||
class Qwen3_5MoeVisionConfig(PreTrainedConfig):
|
||||
model_type = "qwen3_5_moe"
|
||||
base_config_key = "vision_config"
|
||||
|
||||
@@ -164,7 +164,7 @@ class Qwen3_5MoeVisionConfig(PretrainedConfig):
|
||||
self.initializer_range = initializer_range
|
||||
|
||||
|
||||
class Qwen3_5MoeConfig(PretrainedConfig):
|
||||
class Qwen3_5MoeConfig(PreTrainedConfig):
|
||||
model_type = "qwen3_5_moe"
|
||||
sub_configs = {
|
||||
"vision_config": Qwen3_5MoeVisionConfig,
|
||||
@@ -198,7 +198,7 @@ class Qwen3_5MoeConfig(PretrainedConfig):
|
||||
self.vision_start_token_id = vision_start_token_id
|
||||
self.vision_end_token_id = vision_end_token_id
|
||||
super().__init__(**kwargs)
|
||||
# Set after super().__init__() to avoid v4 PretrainedConfig overwrite
|
||||
# Set after super().__init__() to avoid v4 PreTrainedConfig overwrite
|
||||
self.tie_word_embeddings = tie_word_embeddings
|
||||
|
||||
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.modeling_rope_utils import rope_config_validation
|
||||
from transformers.utils import logging
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
|
||||
|
||||
class Qwen3ASRAudioEncoderConfig(PretrainedConfig):
|
||||
class Qwen3ASRAudioEncoderConfig(PreTrainedConfig):
|
||||
r"""
|
||||
This is the configuration class to store the configuration of a [`Qwen3ASRAudioEncoder`]. It is used to instantiate a
|
||||
Qwen3-ASR audio encoder according to the specified arguments, defining the model architecture. Instantiating a
|
||||
@@ -33,8 +33,8 @@ class Qwen3ASRAudioEncoderConfig(PretrainedConfig):
|
||||
|
||||
e.g. [Qwen/Qwen3-ASR-1.7B](https://huggingface.co/Qwen/Qwen3-ASR-1.7B)
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PretrainedConfig`] for more information.
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PreTrainedConfig`] for more information.
|
||||
|
||||
Args:
|
||||
num_mel_bins (`int`, *optional*, defaults to 128):
|
||||
@@ -130,15 +130,15 @@ class Qwen3ASRAudioEncoderConfig(PretrainedConfig):
|
||||
self.downsample_hidden_size = downsample_hidden_size
|
||||
|
||||
|
||||
class Qwen3ASRTextConfig(PretrainedConfig):
|
||||
class Qwen3ASRTextConfig(PreTrainedConfig):
|
||||
r"""
|
||||
This is the configuration class to store the configuration of a [`Qwen3ASRTextModel`]. It is used to instantiate a
|
||||
Qwen3-ASR model according to the specified arguments, defining the model architecture. Instantiating a configuration
|
||||
with the defaults will yield a similar configuration to that of
|
||||
Qwen3-ASR-1.7B [Qwen/Qwen3-ASR-1.7B](https://huggingface.co/Qwen/Qwen3-ASR-1.7B)
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PretrainedConfig`] for more information.
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PreTrainedConfig`] for more information.
|
||||
|
||||
Args:
|
||||
vocab_size (`int`, *optional*, defaults to 151936):
|
||||
@@ -285,7 +285,7 @@ class Qwen3ASRTextConfig(PretrainedConfig):
|
||||
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
|
||||
|
||||
|
||||
class Qwen3ASRThinkerConfig(PretrainedConfig):
|
||||
class Qwen3ASRThinkerConfig(PreTrainedConfig):
|
||||
r"""
|
||||
This is the configuration class to store the configuration of a [`Qwen3ASRThinker`]. It is used to instantiate a
|
||||
Qwen3-ASR-Thinker model according to the specified arguments, defining the model architecture. Instantiating a
|
||||
@@ -294,8 +294,8 @@ class Qwen3ASRThinkerConfig(PretrainedConfig):
|
||||
|
||||
e.g. [Qwen/Qwen3-ASR-1.7B](https://huggingface.co/Qwen/Qwen3-ASR-1.7B)
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PretrainedConfig`] for more information.
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PreTrainedConfig`] for more information.
|
||||
|
||||
Args:
|
||||
audio_config (`dict`, *optional*):
|
||||
@@ -365,7 +365,7 @@ class Qwen3ASRThinkerConfig(PretrainedConfig):
|
||||
self.audio_token_id = audio_token_id
|
||||
|
||||
|
||||
class Qwen3ASRConfig(PretrainedConfig):
|
||||
class Qwen3ASRConfig(PreTrainedConfig):
|
||||
"""
|
||||
This is the configuration class to store the configuration of a [`Qwen3ASRForConditionalGeneration`]. It is used to instantiate a Qwen3ASR
|
||||
model according to the specified sub-models configurations, defining the model architecture.
|
||||
@@ -373,8 +373,8 @@ class Qwen3ASRConfig(PretrainedConfig):
|
||||
Instantiating a configuration with the defaults will yield a similar configuration to that of the
|
||||
[Qwen/Qwen3-ASR-1.7B](https://huggingface.co/Qwen/Qwen3-ASR-1.7B) architecture.
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PretrainedConfig`] for more information.
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PreTrainedConfig`] for more information.
|
||||
|
||||
Args:
|
||||
thinker_config (`dict`, *optional*): Configuration of the underlying thinker sub-model.
|
||||
@@ -437,7 +437,7 @@ class Qwen3ASRConfig(PretrainedConfig):
|
||||
self.timestamp_segment_time = timestamp_segment_time
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def get_text_config(self, decoder=False) -> "PretrainedConfig":
|
||||
def get_text_config(self, decoder=False) -> "PreTrainedConfig":
|
||||
"""
|
||||
Returns the config that is meant to be used with text IO. On most models, it is the original config instance
|
||||
itself. On specific composite models, it is under a set of valid names.
|
||||
|
||||
@@ -16,20 +16,20 @@
|
||||
# limitations under the License.
|
||||
"""Qwen3-Next model configuration."""
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.utils import logging
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
|
||||
|
||||
class Qwen3NextConfig(PretrainedConfig):
|
||||
class Qwen3NextConfig(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a [`Qwen3NextModel`]. It is used to instantiate a
|
||||
Qwen3-Next model according to the specified arguments, defining the model architecture.
|
||||
Instantiating a configuration with the defaults will yield a similar configuration to that of
|
||||
Qwen3-Next-80B-A3B-Instruct [Qwen/Qwen3-Next-80B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Next-80B-A3B-Instruct).
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PretrainedConfig`] for more information.
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
|
||||
documentation from [`PreTrainedConfig`] for more information.
|
||||
|
||||
|
||||
Args:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
from transformers.utils import logging
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
@@ -20,7 +20,7 @@ OPENAI_CLIP_MEAN = (0.48145466, 0.4578275, 0.40821073)
|
||||
OPENAI_CLIP_STD = (0.26862954, 0.26130258, 0.27577711)
|
||||
|
||||
|
||||
class RadioConfig(PretrainedConfig):
|
||||
class RadioConfig(PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a Radio
|
||||
vision model. It is used to instantiate a Radio model according to the
|
||||
specified arguments, defining the model architecture.
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
from dataclasses import fields
|
||||
from typing import Any
|
||||
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm.transformers_utils.configs.speculators.algos import (
|
||||
SUPPORTED_SPECULATORS_TYPES,
|
||||
@@ -12,13 +12,13 @@ from vllm.transformers_utils.configs.speculators.algos import (
|
||||
from vllm.transformers_utils.utils import without_trust_remote_code
|
||||
|
||||
|
||||
class SpeculatorsConfig(PretrainedConfig):
|
||||
class SpeculatorsConfig(PreTrainedConfig):
|
||||
model_type = "speculators"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
# super().__init__ performs some validation before setting all kwargs as
|
||||
# attributes, so we set them first to be safe
|
||||
pre_trained_config_fields = {f.name for f in fields(PretrainedConfig)}
|
||||
pre_trained_config_fields = {f.name for f in fields(PreTrainedConfig)}
|
||||
super_kwargs = dict()
|
||||
for key, value in kwargs.items():
|
||||
if key == "model_type":
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class Step3VisionEncoderConfig(PretrainedConfig):
|
||||
class Step3VisionEncoderConfig(PreTrainedConfig):
|
||||
model_type = "step3_vision_encoder"
|
||||
|
||||
def __init__(
|
||||
@@ -35,7 +35,7 @@ class Step3VisionEncoderConfig(PretrainedConfig):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class Step3TextConfig(PretrainedConfig):
|
||||
class Step3TextConfig(PreTrainedConfig):
|
||||
model_type = "step3_text"
|
||||
architectures = ["Step3TextForCausalLM"]
|
||||
|
||||
@@ -146,7 +146,7 @@ class Step3TextConfig(PretrainedConfig):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class Step3VLConfig(PretrainedConfig):
|
||||
class Step3VLConfig(PreTrainedConfig):
|
||||
model_type = "step3_vl"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
from transformers.configuration_utils import PreTrainedConfig
|
||||
|
||||
|
||||
class Step3p5Config(PretrainedConfig):
|
||||
class Step3p5Config(PreTrainedConfig):
|
||||
model_type = "step3p5"
|
||||
|
||||
def __init__(
|
||||
|
||||
@@ -7,14 +7,14 @@ from typing import Any
|
||||
import transformers
|
||||
|
||||
|
||||
class UltravoxConfig(transformers.PretrainedConfig):
|
||||
class UltravoxConfig(transformers.PreTrainedConfig):
|
||||
r"""This is the configuration class to store the configuration of a
|
||||
[`UltravoxForConditionalGeneration`]. It is used to instantiate an
|
||||
Ultravox model according to the specified arguments, defining the model
|
||||
architecture.
|
||||
|
||||
Configuration objects inherit from [`PretrainedConfig`] and can be used to
|
||||
control the model outputs. Read the documentation from [`PretrainedConfig`]
|
||||
Configuration objects inherit from [`PreTrainedConfig`] and can be used to
|
||||
control the model outputs. Read the documentation from [`PreTrainedConfig`]
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
@@ -74,7 +74,7 @@ class UltravoxConfig(transformers.PretrainedConfig):
|
||||
self.num_projector_layers = num_projector_layers
|
||||
|
||||
# N.B. May set the wrapped_model_config below.
|
||||
self.wrapped_model_config: transformers.PretrainedConfig
|
||||
self.wrapped_model_config: transformers.PreTrainedConfig
|
||||
self.text_model_id = text_model_id
|
||||
if text_model_id is None:
|
||||
text_config = text_config or {}
|
||||
@@ -113,7 +113,7 @@ class UltravoxConfig(transformers.PretrainedConfig):
|
||||
return super().__setattr__(key, value)
|
||||
|
||||
@property
|
||||
def text_config(self) -> transformers.PretrainedConfig:
|
||||
def text_config(self) -> transformers.PreTrainedConfig:
|
||||
# When Ultravox wraps a multi-modal model (e.g. Gemma), we instantiate
|
||||
# the full model, but the text config is the text config of the inner
|
||||
# model.
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import final
|
||||
|
||||
import torch
|
||||
from safetensors.torch import _TYPES as _SAFETENSORS_TO_TORCH_DTYPE
|
||||
from transformers import PretrainedConfig
|
||||
from transformers import PreTrainedConfig
|
||||
|
||||
from vllm import envs
|
||||
from vllm.config.model_arch import (
|
||||
@@ -26,8 +26,8 @@ logger = init_logger(__name__)
|
||||
class ModelArchConfigConvertorBase:
|
||||
def __init__(
|
||||
self,
|
||||
hf_config: PretrainedConfig,
|
||||
hf_text_config: PretrainedConfig,
|
||||
hf_config: PreTrainedConfig,
|
||||
hf_text_config: PreTrainedConfig,
|
||||
revision: str | None = None,
|
||||
):
|
||||
self.hf_config = hf_config
|
||||
@@ -36,7 +36,7 @@ class ModelArchConfigConvertorBase:
|
||||
|
||||
def get_per_layer_hf_configs(
|
||||
self,
|
||||
) -> list[tuple[PretrainedConfig, PretrainedConfig]] | None:
|
||||
) -> list[tuple[PreTrainedConfig, PreTrainedConfig]] | None:
|
||||
"""`(hf_config, hf_text_config)` per layer, or `None` if homogeneous.
|
||||
|
||||
This is the only place that decides whether a checkpoint is heterogeneous
|
||||
@@ -219,7 +219,7 @@ class ModelArchConfigConvertorBase:
|
||||
@classmethod
|
||||
def get_torch_dtype(
|
||||
cls,
|
||||
hf_config: PretrainedConfig,
|
||||
hf_config: PreTrainedConfig,
|
||||
model_id: str,
|
||||
revision: str | None,
|
||||
config_format: str | ConfigFormat,
|
||||
@@ -257,7 +257,7 @@ class ModelArchConfigConvertorBase:
|
||||
|
||||
return config_dtype
|
||||
|
||||
def _normalize_quantization_config(self, config: PretrainedConfig):
|
||||
def _normalize_quantization_config(self, config: PreTrainedConfig):
|
||||
quant_cfg = getattr(config, "quantization_config", None)
|
||||
if quant_cfg is None:
|
||||
# compressed-tensors uses a "compression_config" key
|
||||
@@ -585,8 +585,8 @@ class DeepSeekMTPModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
class DeepseekV4ModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
def __init__(
|
||||
self,
|
||||
hf_config: PretrainedConfig,
|
||||
hf_text_config: PretrainedConfig,
|
||||
hf_config: PreTrainedConfig,
|
||||
hf_text_config: PreTrainedConfig,
|
||||
revision: str | None = None,
|
||||
):
|
||||
# DeepSeek-V4-Flash-Vision-Exp ships the same architectures/model_type
|
||||
@@ -622,7 +622,7 @@ class MimoMTPModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
|
||||
|
||||
def _strip_mimo_v2_attention_chunk_size(
|
||||
hf_config: PretrainedConfig, hf_text_config: PretrainedConfig
|
||||
hf_config: PreTrainedConfig, hf_text_config: PreTrainedConfig
|
||||
) -> None:
|
||||
# MiMo-V2-Flash's config.json sets `attention_chunk_size=128` but the
|
||||
# architecture does not actually use chunked local attention. Leaving it
|
||||
@@ -635,8 +635,8 @@ def _strip_mimo_v2_attention_chunk_size(
|
||||
class MimoV2ModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
def __init__(
|
||||
self,
|
||||
hf_config: PretrainedConfig,
|
||||
hf_text_config: PretrainedConfig,
|
||||
hf_config: PreTrainedConfig,
|
||||
hf_text_config: PreTrainedConfig,
|
||||
revision: str | None = None,
|
||||
):
|
||||
if getattr(hf_config, "vision_config", None):
|
||||
@@ -648,8 +648,8 @@ class MimoV2ModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
class MimoV2MTPModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
def __init__(
|
||||
self,
|
||||
hf_config: PretrainedConfig,
|
||||
hf_text_config: PretrainedConfig,
|
||||
hf_config: PreTrainedConfig,
|
||||
hf_text_config: PreTrainedConfig,
|
||||
revision: str | None = None,
|
||||
):
|
||||
super().__init__(hf_config, hf_text_config, revision)
|
||||
@@ -742,7 +742,7 @@ class Gemma4ModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
|
||||
def get_per_layer_hf_configs(
|
||||
self,
|
||||
) -> list[tuple[PretrainedConfig, PretrainedConfig]] | None:
|
||||
) -> list[tuple[PreTrainedConfig, PreTrainedConfig]] | None:
|
||||
# Gemma4 uses a larger head dimension, and sometimes more KV heads, on its
|
||||
# full attention layers than on its sliding ones. Transformers >= 5.15.0
|
||||
# says so in the config; before that the values are flat attributes picked
|
||||
@@ -763,7 +763,7 @@ class Gemma4ModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
|
||||
|
||||
class MossAudioModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
def _language_config(self) -> PretrainedConfig:
|
||||
def _language_config(self) -> PreTrainedConfig:
|
||||
return self.hf_config.language_config
|
||||
|
||||
def get_num_hidden_layers(self) -> int:
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
# Adapted from
|
||||
# https://github.com/zai-org/CogAgent
|
||||
from transformers import PythonBackend
|
||||
from transformers.image_processing_utils_fast import BaseImageProcessorFast
|
||||
from transformers.image_processing_backends import TorchvisionBackend
|
||||
from transformers.image_utils import PILImageResampling
|
||||
from transformers.processing_utils import ProcessorMixin
|
||||
|
||||
|
||||
class GLM4VImageProcessorFast(BaseImageProcessorFast):
|
||||
class GLM4VImageProcessorFast(TorchvisionBackend):
|
||||
"""Port of https://huggingface.co/zai-org/glm-4v-9b/blob/main/tokenization_chatglm.py#L177
|
||||
to HF Transformers.
|
||||
"""
|
||||
|
||||
@@ -7,12 +7,12 @@ import math
|
||||
import numpy as np
|
||||
import torch
|
||||
from torchvision.transforms.v2 import functional as tvF
|
||||
from transformers.image_processing_utils import BatchFeature
|
||||
from transformers.image_processing_utils_fast import (
|
||||
BaseImageProcessorFast,
|
||||
from transformers.image_processing_backends import (
|
||||
TorchvisionBackend,
|
||||
group_images_by_shape,
|
||||
reorder_images,
|
||||
)
|
||||
from transformers.image_processing_utils import BatchFeature
|
||||
from transformers.image_utils import (
|
||||
OPENAI_CLIP_MEAN,
|
||||
OPENAI_CLIP_STD,
|
||||
@@ -327,7 +327,7 @@ class Glm5NextImageProcessorKwargs(ImagesKwargs, total=False): # type: ignore[c
|
||||
max_image_tokens: int | None
|
||||
|
||||
|
||||
class Glm5NextImageProcessor(BaseImageProcessorFast):
|
||||
class Glm5NextImageProcessor(TorchvisionBackend):
|
||||
"""Fast torchvision image processor for GLM-5.3-Flash.
|
||||
|
||||
``patch_expand_factor`` multiplies into the ``smart_resize`` spatial
|
||||
@@ -759,7 +759,7 @@ class Glm5NextProcessor(ProcessorMixin):
|
||||
attributes = ["image_processor", "tokenizer", "video_processor"]
|
||||
image_processor_class = "AutoImageProcessor"
|
||||
video_processor_class = "AutoVideoProcessor"
|
||||
tokenizer_class = ("PreTrainedTokenizer", "PreTrainedTokenizerFast")
|
||||
tokenizer_class = ("PythonBackend", "TokenizersBackend")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -18,8 +18,8 @@ import math
|
||||
import torch
|
||||
from torchvision.transforms import InterpolationMode
|
||||
from transformers import AutoTokenizer, BatchFeature
|
||||
from transformers.image_processing_utils_fast import (
|
||||
BaseImageProcessorFast,
|
||||
from transformers.image_processing_backends import (
|
||||
TorchvisionBackend,
|
||||
group_images_by_shape,
|
||||
reorder_images,
|
||||
)
|
||||
@@ -156,7 +156,7 @@ class MiniMaxM3VLImageProcessorKwargs(ImagesKwargs, total=False): # type: ignor
|
||||
max_long_side_pixel: int
|
||||
|
||||
|
||||
class MiniMaxM3VLImageProcessor(BaseImageProcessorFast):
|
||||
class MiniMaxM3VLImageProcessor(TorchvisionBackend):
|
||||
do_resize = True
|
||||
resample = PILImageResampling.BICUBIC
|
||||
# required by base-class validation, not used as the resize bound
|
||||
|
||||
@@ -437,7 +437,7 @@ class MuseGlimmerProcessor(ProcessorMixin):
|
||||
attributes = ["image_processor", "video_processor", "tokenizer"]
|
||||
image_processor_class = "AutoImageProcessor"
|
||||
video_processor_class = "AutoVideoProcessor"
|
||||
tokenizer_class = "PreTrainedTokenizerFast"
|
||||
tokenizer_class = "TokenizersBackend"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -20,7 +20,7 @@ import numpy.typing as npt
|
||||
import regex as re
|
||||
import torch
|
||||
from PIL import Image
|
||||
from transformers import BatchFeature, PretrainedConfig, TensorType
|
||||
from transformers import BatchFeature, PreTrainedConfig, TensorType
|
||||
|
||||
from vllm.model_executor.models.parakeet import ParakeetExtractor
|
||||
from vllm.multimodal.inputs import AudioItem
|
||||
@@ -584,7 +584,7 @@ class BaseNanoNemotronVLProcessor(ABC):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
tokenizer: HfTokenizer,
|
||||
*args,
|
||||
max_model_len: int,
|
||||
@@ -623,7 +623,7 @@ class BaseNanoNemotronVLProcessor(ABC):
|
||||
self.dtype: torch.dtype = getattr(config, "dtype", torch.float32)
|
||||
|
||||
@staticmethod
|
||||
def use_dynamic_resolution(config: PretrainedConfig) -> bool:
|
||||
def use_dynamic_resolution(config: PreTrainedConfig) -> bool:
|
||||
return "min_num_patches" in config.vision_config.args
|
||||
|
||||
@property
|
||||
@@ -771,7 +771,7 @@ class NanoNemotronVLProcessor(BaseNanoNemotronVLProcessor):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: PretrainedConfig,
|
||||
config: PreTrainedConfig,
|
||||
tokenizer: HfTokenizer,
|
||||
*,
|
||||
max_model_len: int,
|
||||
|
||||
Reference in New Issue
Block a user