vllm.model_executor.models.mllama4
¶
Classes:
-
Llama4ForConditionalGeneration– -
Llama4ImagePatchInputs–Dimensions:
-
Llama4VisionEncoder–
Llama4ForConditionalGeneration
¶
Bases: Module, SupportsMultiModal, SupportsPP, MixtureOfExperts, SupportsEncoderCudaGraph, SupportsEagle3, SupportsLoRA
Methods:
-
get_mm_mapping–Get the module prefix in multimodal models.
_load_other_weights(other_weights, params_dict, stacked_params_mapping)
¶
Load non-language-model weights with stacking support.
_rename_weight_for_modelopt_checkpoint(name)
¶
Rename weights from ModelOpt llama4 fp8 checkpoints to vLLM format.
get_mm_mapping()
¶
Get the module prefix in multimodal models.
Llama4ImagePatchInputs
¶
Bases: TensorSchema
Dimensions: - batch_size: Batch size - total_num_chunks: Batch size * number of chunks - num_channels: Number of channels - image_size: Size of each image
Attributes:
-
aspect_ratios(Annotated[Tensor, TensorShape(batch_size, 2)]) –A list of aspect ratios corresponding to the number of tiles
-
patches_per_image(Annotated[Tensor, TensorShape(batch_size)]) –The number of chunked image tiles for each image in the batch.
aspect_ratios
instance-attribute
¶
A list of aspect ratios corresponding to the number of tiles in each dimension that each image in the batch corresponds to. Each aspect ratio is a pair (ratio_h, ratio_w).
patches_per_image
instance-attribute
¶
The number of chunked image tiles for each image in the batch.
This is used to split the embeddings which has the first two dimensions
flattened just like pixel_values.