vllm.model_executor.models.cohere2_vision
¶
Command-A-Vision (Cohere2Vision) multimodal model implementation for vLLM.
Classes:
-
Cohere2VisionForConditionalGeneration– -
Cohere2VisionImagePixelInputs–Dimensions:
-
Cohere2VisionMultiModalProjector–Multimodal projector that maps vision features to text embedding space.
-
Cohere2VisionProcessingInfo–
Cohere2VisionForConditionalGeneration
¶
Bases: Module, SupportsMultiModal, SupportsPP, SupportsQuant
_process_image_input(image_input, **kwargs)
¶
Process image pixels through vision tower and projector.
Parameters:
-
(image_input¶Cohere2VisionImagePixelInputs) –Validated image input containing pixel values and patch counts
-
(**kwargs¶object, default:{}) –Unused; accepted for interface compatibility.
Returns:
Cohere2VisionImagePixelInputs
¶
Bases: TensorSchema
Dimensions: - np: The total number of patches over each image over each prompt in the batch - c: Number of channels - h: Height of each image patch - w: Width of each image patch - bn: Batch size * number of images
Cohere2VisionMultiModalProjector
¶
Bases: Module
Multimodal projector that maps vision features to text embedding space.
Uses pixel shuffle downsampling followed by SwiGLU activation.
Methods:
-
pixel_shuffle–Apply pixel shuffle downsampling to reduce spatial dimensions.
Cohere2VisionProcessingInfo
¶
Bases: BaseProcessingInfo
Methods:
-
get_num_patches–Calculate the number of image patches for a given image.
get_num_patches(*, image_width, image_height, processor, mm_kwargs)
¶
Calculate the number of image patches for a given image. Uses the HF processor to determine the actual number of patches.