pub struct CLIPConfig {Show 17 fields
pub vocab_size: usize,
pub hidden_size: usize,
pub num_hidden_layers: usize,
pub context_length: usize,
pub transformer_width: usize,
pub transformer_heads: usize,
pub transformer_layers: usize,
pub image_resolution: usize,
pub vision_layers: usize,
pub vision_width: usize,
pub vision_heads: usize,
pub vision_patch_size: usize,
pub embed_dim: usize,
pub projection_dim: usize,
pub layer_norm_eps: f32,
pub attention_dropout: f32,
pub initializer_range: f32,
}Fields§
§vocab_size: usize§context_length: usize§transformer_width: usize§transformer_heads: usize§transformer_layers: usize§image_resolution: usize§vision_layers: usize§vision_width: usize§vision_heads: usize§vision_patch_size: usize§embed_dim: usize§projection_dim: usize§layer_norm_eps: f32§attention_dropout: f32§initializer_range: f32Implementations§
Source§impl CLIPConfig
impl CLIPConfig
Sourcepub fn from_gguf_config(gguf: &GGUFModelConfig) -> Self
pub fn from_gguf_config(gguf: &GGUFModelConfig) -> Self
Create CLIPConfig from GGUF model configuration Note: GGUF files for CLIP are rare, but this provides compatibility
Sourcepub fn vision_head_dim(&self) -> usize
pub fn vision_head_dim(&self) -> usize
Get vision head dimension
Sourcepub fn text_head_dim(&self) -> usize
pub fn text_head_dim(&self) -> usize
Get text head dimension
Sourcepub fn num_patches(&self) -> usize
pub fn num_patches(&self) -> usize
Get number of patches (excluding CLS token)
Sourcepub fn num_positions(&self) -> usize
pub fn num_positions(&self) -> usize
Get number of positions (patches + CLS token)
Trait Implementations§
Source§impl Clone for CLIPConfig
impl Clone for CLIPConfig
Source§fn clone(&self) -> CLIPConfig
fn clone(&self) -> CLIPConfig
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 CLIPConfig
impl Debug for CLIPConfig
Source§impl Default for CLIPConfig
impl Default for CLIPConfig
Source§impl<'de> Deserialize<'de> for CLIPConfig
impl<'de> Deserialize<'de> for CLIPConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ModelConfig for CLIPConfig
impl ModelConfig for CLIPConfig
Auto Trait Implementations§
impl Freeze for CLIPConfig
impl RefUnwindSafe for CLIPConfig
impl Send for CLIPConfig
impl Sync for CLIPConfig
impl Unpin for CLIPConfig
impl UnsafeUnpin for CLIPConfig
impl UnwindSafe for CLIPConfig
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
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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