Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vllm/model_executor/models/gemma4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,11 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
quant_params = router_quant_params[router_name]
if len(quant_params) == 3:
weight_name = f"{router_name}.weight"
if is_pp_missing_parameter(weight_name, self):
del router_quant_params[router_name]
continue
if weight_name not in params_dict:
raise KeyError(weight_name)
param = params_dict[weight_name]
weight_loader = getattr(
param, "weight_loader", default_weight_loader
Expand Down
8 changes: 5 additions & 3 deletions vllm/tokenizers/registry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import contextlib
import copy
from dataclasses import dataclass, field
from functools import lru_cache
from pathlib import Path
Expand Down Expand Up @@ -104,6 +105,7 @@ def _maybe_patch_gemma4_gguf_tokenizer(
if not special_ids:
return tokenizer

patched_tokenizer = copy.copy(tokenizer)
token_attrs = {
"padding_token_id": "pad_token",
"bos_token_id": "bos_token",
Expand All @@ -114,12 +116,12 @@ def _maybe_patch_gemma4_gguf_tokenizer(
token_id = special_ids.get(id_attr)
if token_id is None:
continue
token = tokenizer.convert_ids_to_tokens(token_id)
token = patched_tokenizer.convert_ids_to_tokens(token_id)
if token is None:
continue
setattr(tokenizer, token_attr, token)
setattr(patched_tokenizer, token_attr, token)

return tokenizer
return patched_tokenizer


def resolve_tokenizer_args(
Expand Down
5 changes: 4 additions & 1 deletion vllm/transformers_utils/processor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import copy
import importlib
import inspect
from functools import lru_cache
Expand Down Expand Up @@ -367,7 +368,9 @@ def cached_processor_from_config(
model_config.model,
getattr(model_config.hf_config, "model_type", None),
)
processor.tokenizer = tokenizer
if tokenizer is not processor.tokenizer:
processor = copy.copy(processor)
processor.tokenizer = tokenizer
return processor


Expand Down
Loading