Skip to content

vllm.model_executor.models.paddleocr_vl

Classes:

Functions:

  • all_gather_interleave –

    All-gather the input tensor interleavely across model parallel group.

  • smart_resize –

    Rescales the image so that the following conditions are met:

PaddleOCRVLForConditionalGeneration

Bases: Module, SupportsMultiModal, SupportsMRoPE

Methods:

  • encode_image –

    Encode the flat patches of all images in one vision tower call.

  • iter_mm_grid_thw –

    Iterate over multimodal features and yield grid information.

encode_image(pixel_values, image_grid_thw)

Encode the flat patches of all images in one vision tower call.

iter_mm_grid_thw(mm_features)

Iterate over multimodal features and yield grid information.

Parameters:

Yields:

  • tuple[int, int, int, int, float] –

    Tuple of (offset, grid_t, grid_h, grid_w, t_factor) for each frame/image

SiglipAttention

Bases: Module

SigLIP vision attention adapted from Qwen2.5-VisionAttention.

all_gather_interleave(local_tensor, hidden_size, tp_size)

All-gather the input tensor interleavely across model parallel group.

smart_resize(height, width, factor=28, min_pixels=28 * 28 * 130, max_pixels=28 * 28 * 1280)

Rescales the image so that the following conditions are met:

  1. Both dimensions (height and width) are divisible by 'factor'.

  2. The total number of pixels is within the range ['min_pixels', 'max_pixels'].

  3. The aspect ratio of the image is maintained as closely as possible.