VisionConfig

Struct VisionConfig 

Source
pub struct VisionConfig {
Show 23 fields pub depth: usize, pub hidden_size: usize, pub num_heads: usize, pub patch_size: usize, pub temporal_patch_size: usize, pub spatial_merge_size: usize, pub intermediate_size: usize, pub out_hidden_size: usize, pub deepstack_visual_indexes: Vec<usize>, pub image_pad_token_id: u32, pub video_pad_token_id: u32, pub max_pixels: Option<usize>, pub hidden_act: String, pub rms_norm_eps: f32, pub attention_bias: bool, pub projection_intermediate_size: usize, pub swiglu_limit: f32, pub rope_theta: f32, pub image_mean: [f32; 3], pub image_std: [f32; 3], pub min_image_tokens: usize, pub max_image_tokens: usize, pub block_major_patches: bool,
}
Expand description

2026-09-26: Vision tower configuration: parse_vision_config for the Qwen family, and the GLM-5.3 parser, which also fills the fields the Qwen parser leaves at their defaults.

Fields§

§depth: usize§hidden_size: usize§num_heads: usize§patch_size: usize§temporal_patch_size: usize§spatial_merge_size: usize§intermediate_size: usize§out_hidden_size: usize§deepstack_visual_indexes: Vec<usize>§image_pad_token_id: u32

2026-09-26: The token that marks where vision embeddings are spliced into the text. 0 means undeclared: the engine then uses vision_encoder::IMAGE_PAD_TOKEN_ID, and the chat tokenizer the id of <|image_pad|>.

§video_pad_token_id: u32

2026-09-26: The video-frame counterpart of Self::image_pad_token_id, with the same 0 rule (VIDEO_PAD_TOKEN_ID, <|video_pad|>).

§max_pixels: Option<usize>

2026-09-26: The vision area bound in pixels. The parsers leave it None; serve_load sets it from resolve_vision_max_pixels before the model is built, and the vision loaders pass it to the encoder.

§hidden_act: String§rms_norm_eps: f32§attention_bias: bool§projection_intermediate_size: usize§swiglu_limit: f32§rope_theta: f32§image_mean: [f32; 3]§image_std: [f32; 3]§min_image_tokens: usize§max_image_tokens: usize§block_major_patches: bool

2026-09-26: Patch tokens in 2x2-block-major order rather than raster; the preprocessor reads it (vision_preprocess). The GLM-5.3 parser sets it.

Implementations§

Trait Implementations§

Source§

impl Clone for VisionConfig

Source§

fn clone(&self) -> VisionConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VisionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VisionConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.