Skip to content

vllm.model_executor.models.llava_next_video

Classes:

LlavaNextVideoForConditionalGeneration

Bases: Module, SupportsLoRA, SupportsMultiModal, SupportsPP

Methods:

  • forward –

    Run forward pass for LlaVA-NeXT-Video.

  • get_mm_mapping –

    Get the module prefix in multimodal models.

_parse_and_validate_video_input(**kwargs)

A legal video input should have the following dimensions: { "pixel_values_videos" : list[b, Tensor(nb_frames, nb_channels, height, width)] }

forward(input_ids, positions, intermediate_tensors=None, inputs_embeds=None, **kwargs)

Run forward pass for LlaVA-NeXT-Video.

Parameters:

  • input_ids

    (Tensor | None) –

    Flattened (concatenated) input_ids corresponding to a batch.

  • positions

    (Tensor) –

    Flattened (concatenated) position ids corresponding to a batch.

  • intermediate_tensors

    (IntermediateTensors | None, default: None ) –

    Intermediate tensors from prior forward pass.

  • inputs_embeds

    (Tensor | None, default: None ) –

    Optional tensor of input embeddings.

  • **kwargs

    (object, default: {} ) –

    Multimodal inputs for this batch, forwarded to the multimodal embedding path.

get_mm_mapping()

Get the module prefix in multimodal models.

LlavaNextVideoPixelInputs

Bases: TensorSchema

Dimensions
  • bn: Batch size * number of videos
  • f: Number of frames
  • c: Number of channels (3)
  • h: Height of each frame
  • w: Width of each frame

Note that f may be different for each batch, in which case the data is passed as a list instead of a batched tensor.

Note that it only supports one video input for one batch.