pub struct ModelMetadataBuilder { /* private fields */ }Expand description
Builder for ModelMetadata.
Implementations§
Source§impl ModelMetadataBuilder
impl ModelMetadataBuilder
Sourcepub fn new(id: impl Into<ModelId>, architecture: ModelArchitecture) -> Self
pub fn new(id: impl Into<ModelId>, architecture: ModelArchitecture) -> Self
Creates a new builder.
Sourcepub fn source(self, source: ModelSource) -> Self
pub fn source(self, source: ModelSource) -> Self
Sets the model source.
Sourcepub fn context_length(self, length: u32) -> Self
pub fn context_length(self, length: u32) -> Self
Sets the context length.
Sourcepub fn vocab_size(self, size: u32) -> Self
pub fn vocab_size(self, size: u32) -> Self
Sets the vocabulary size.
Sets the hidden size.
Sourcepub fn num_layers(self, layers: u32) -> Self
pub fn num_layers(self, layers: u32) -> Self
Sets the number of layers.
Sourcepub fn num_attention_heads(self, heads: u32) -> Self
pub fn num_attention_heads(self, heads: u32) -> Self
Sets the number of attention heads.
Sourcepub fn num_kv_heads(self, heads: u32) -> Self
pub fn num_kv_heads(self, heads: u32) -> Self
Sets the number of KV heads.
Sourcepub fn quantization(self, quant: QuantizationType) -> Self
pub fn quantization(self, quant: QuantizationType) -> Self
Sets the quantization type.
Sourcepub fn size_bytes(self, size: u64) -> Self
pub fn size_bytes(self, size: u64) -> Self
Sets the model size in bytes.
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Sets the description.
Sourcepub fn build(self) -> ModelMetadata
pub fn build(self) -> ModelMetadata
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelMetadataBuilder
impl RefUnwindSafe for ModelMetadataBuilder
impl Send for ModelMetadataBuilder
impl Sync for ModelMetadataBuilder
impl Unpin for ModelMetadataBuilder
impl UnwindSafe for ModelMetadataBuilder
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