Skip to content

Commit 4276ac0

Browse files
committed
remove llama4 registry
Signed-off-by: Lu Fang <fanglu@fb.com>
1 parent 83cdc27 commit 4276ac0

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

tests/models/test_registry.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
@pytest.mark.parametrize("model_arch", ModelRegistry.get_supported_archs())
2525
def test_registry_imports(model_arch):
2626

27-
# Llama4ForCausalLM does not have a standalone model
28-
if model_arch == "Llama4ForCausalLM":
29-
return
30-
3127
model_info = HF_EXAMPLE_MODELS.get_hf_info(model_arch)
3228
model_info.check_transformers_version(on_fail="skip")
3329

@@ -99,9 +95,6 @@ def test_hf_registry_coverage():
9995
untested_archs = set(ModelRegistry.get_supported_archs() -
10096
HF_EXAMPLE_MODELS.get_supported_archs())
10197

102-
# Llama4ForCausalLM does not have a standalone model
103-
untested_archs.discard("Llama4ForCausalLM")
104-
10598
assert not untested_archs, (
10699
"Please add the following architectures to "
107100
f"`tests/models/registry.py`: {untested_archs}")

vllm/model_executor/models/mllama4.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555
from vllm.transformers_utils.tokenizer import cached_tokenizer_from_config
5656

5757
from .interfaces import MultiModalEmbeddings, SupportsMultiModal
58-
from .utils import (AutoWeightsLoader, flatten_bn, init_vllm_registered_model,
59-
maybe_prefix, merge_multimodal_embeddings)
58+
from .llama4 import Llama4ForCausalLM
59+
from .utils import (AutoWeightsLoader, flatten_bn, maybe_prefix,
60+
merge_multimodal_embeddings)
6061
from .vision import scatter_patch_features, select_patch_features
6162

6263
logger = init_logger(__name__)
@@ -710,12 +711,12 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
710711
self.config,
711712
None,
712713
prefix=maybe_prefix(prefix, "multi_modal_projector"))
713-
self.language_model = init_vllm_registered_model(
714-
vllm_config=vllm_config,
715-
hf_config=config.text_config,
716-
architectures=["Llama4ForCausalLM"],
717-
prefix=maybe_prefix(prefix, "language_model"))
718-
714+
language_model_vllm_config = vllm_config.with_hf_config(
715+
config.text_config, architectures=["Llama4ForCausalLM"])
716+
self.language_model = Llama4ForCausalLM(
717+
vllm_config=language_model_vllm_config,
718+
prefix=maybe_prefix(prefix, "language_model"),
719+
)
719720
self.tokenizer = cached_tokenizer_from_config(vllm_config.model_config)
720721

721722
def _parse_and_validate_image_input(
@@ -857,9 +858,8 @@ def load_weights(self, weights: Iterable[Tuple[str,
857858

858859
# language_model is an Llama4ForCausalLM instance. We load it's
859860
# using llama4's load_weights routine.
860-
language_model_prefix = "language_model.model."
861861
language_model_weights, other_weights = self.separate_weights(
862-
weights, prefix=language_model_prefix)
862+
weights, prefix="language_model.model.")
863863
loader = AutoWeightsLoader(self)
864864
loaded_language_model_params = loader.load_weights(
865865
language_model_weights)

vllm/model_executor/models/registry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"JAISLMHeadModel": ("jais", "JAISLMHeadModel"),
7474
"JambaForCausalLM": ("jamba", "JambaForCausalLM"),
7575
"LlamaForCausalLM": ("llama", "LlamaForCausalLM"),
76-
"Llama4ForCausalLM": ("llama4", "Llama4ForCausalLM"),
7776
# For decapoda-research/llama-*
7877
"LLaMAForCausalLM": ("llama", "LlamaForCausalLM"),
7978
"MambaForCausalLM": ("mamba", "MambaForCausalLM"),

0 commit comments

Comments
 (0)