pub struct GemmaMultimodalConfig {
pub vision: Option<GemmaVisionConfig>,
pub audio: Option<GemmaAudioConfig>,
pub image_token_id: Option<u32>,
pub audio_token_id: Option<u32>,
pub video_token_id: Option<u32>,
pub boi_token_id: Option<u32>,
pub eoi_token_id: Option<u32>,
pub boa_token_id: Option<u32>,
pub eoa_token_index: Option<u32>,
}Expand description
Bundle of multimodal sub-configs + the placeholder token ids the LM uses to mark where media projections go in the token stream.
Fields§
§vision: Option<GemmaVisionConfig>§audio: Option<GemmaAudioConfig>§image_token_id: Option<u32>§audio_token_id: Option<u32>§video_token_id: Option<u32>§boi_token_id: Option<u32>§eoi_token_id: Option<u32>§boa_token_id: Option<u32>§eoa_token_index: Option<u32>Implementations§
Source§impl GemmaMultimodalConfig
impl GemmaMultimodalConfig
Sourcepub fn from_file(path: &Path) -> Result<GemmaMultimodalConfig, Error>
pub fn from_file(path: &Path) -> Result<GemmaMultimodalConfig, Error>
Read the unified config and extract the multimodal blocks (vision_config, audio_config, image/audio/video token ids). Returns an empty config when none of them are present, so pre-Gemma-4 callers get a no-op value.
Sourcepub fn parse_json(raw: &str) -> Result<GemmaMultimodalConfig, Error>
pub fn parse_json(raw: &str) -> Result<GemmaMultimodalConfig, Error>
Parse multimodal fields from a unified HF config.json string.
pub fn has_vision(&self) -> bool
pub fn has_audio(&self) -> bool
Trait Implementations§
Source§impl Clone for GemmaMultimodalConfig
impl Clone for GemmaMultimodalConfig
Source§fn clone(&self) -> GemmaMultimodalConfig
fn clone(&self) -> GemmaMultimodalConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GemmaMultimodalConfig
impl Debug for GemmaMultimodalConfig
Source§impl Default for GemmaMultimodalConfig
impl Default for GemmaMultimodalConfig
Source§fn default() -> GemmaMultimodalConfig
fn default() -> GemmaMultimodalConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GemmaMultimodalConfig
impl<'de> Deserialize<'de> for GemmaMultimodalConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GemmaMultimodalConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GemmaMultimodalConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GemmaMultimodalConfig
impl RefUnwindSafe for GemmaMultimodalConfig
impl Send for GemmaMultimodalConfig
impl Sync for GemmaMultimodalConfig
impl Unpin for GemmaMultimodalConfig
impl UnsafeUnpin for GemmaMultimodalConfig
impl UnwindSafe for GemmaMultimodalConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more