pub struct ModelParameters {
pub model_name: String,
pub model_version: Option<String>,
pub provider: Option<String>,
pub parameters: HashMap<String, Value>,
pub hyperparameters: HashMap<String, Value>,
pub weights_hash: Option<String>,
}Expand description
AI model parameters for reproducibility and tracking
Captures the configuration of an AI model including its name, version, provider, and all parameters needed for reproducible execution.
§Examples
use briefcase_core::models::ModelParameters;
use serde_json::json;
let params = ModelParameters::new("gpt-4")
.with_provider("openai")
.with_parameter("temperature", json!(0.7))
.with_hyperparameter("max_tokens", json!(1000));Fields§
§model_name: String§model_version: Option<String>§provider: Option<String>§parameters: HashMap<String, Value>§hyperparameters: HashMap<String, Value>§weights_hash: Option<String>Implementations§
Source§impl ModelParameters
impl ModelParameters
pub fn new(model_name: impl Into<String>) -> Self
pub fn with_provider(self, provider: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_parameter(self, key: impl Into<String>, value: Value) -> Self
pub fn with_hyperparameter(self, key: impl Into<String>, value: Value) -> Self
pub fn with_weights_hash(self, hash: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for ModelParameters
impl Clone for ModelParameters
Source§fn clone(&self) -> ModelParameters
fn clone(&self) -> ModelParameters
Returns a duplicate of the value. Read more
1.0.0 · 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 ModelParameters
impl Debug for ModelParameters
Source§impl<'de> Deserialize<'de> for ModelParameters
impl<'de> Deserialize<'de> for ModelParameters
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 PartialEq for ModelParameters
impl PartialEq for ModelParameters
Source§impl Serialize for ModelParameters
impl Serialize for ModelParameters
impl StructuralPartialEq for ModelParameters
Auto Trait Implementations§
impl Freeze for ModelParameters
impl RefUnwindSafe for ModelParameters
impl Send for ModelParameters
impl Sync for ModelParameters
impl Unpin for ModelParameters
impl UnwindSafe for ModelParameters
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