#[non_exhaustive]pub struct ModelConfig {
pub accept_eula: bool,
pub hugging_face_access_token: String,
pub hugging_face_cache_enabled: bool,
pub model_display_name: String,
pub container_spec: Option<ModelContainerSpec>,
pub model_user_id: String,
/* private fields */
}model-garden-service only.Expand description
The model config to use for the deployment.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.accept_eula: boolOptional. Whether the user accepts the End User License Agreement (EULA) for the model.
hugging_face_access_token: StringOptional. The Hugging Face read access token used to access the model artifacts of gated models.
hugging_face_cache_enabled: boolOptional. If true, the model will deploy with a cached version instead of directly downloading the model artifacts from Hugging Face. This is suitable for VPC-SC users with limited internet access.
model_display_name: StringOptional. The user-specified display name of the uploaded model. If not set, a default name will be used.
container_spec: Option<ModelContainerSpec>Optional. The specification of the container that is to be used when deploying. If not set, the default container spec will be used.
model_user_id: StringOptional. The ID to use for the uploaded Model, which will become the final component of the model resource name. When not provided, Vertex AI will generate a value for this ID. When Model Registry model is provided, this field will be ignored.
This value may be up to 63 characters, and valid characters are
[a-z0-9_-]. The first character cannot be a number or hyphen.
Implementations§
Source§impl ModelConfig
impl ModelConfig
pub fn new() -> Self
Sourcepub fn set_accept_eula<T: Into<bool>>(self, v: T) -> Self
pub fn set_accept_eula<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_hugging_face_access_token<T: Into<String>>(self, v: T) -> Self
pub fn set_hugging_face_access_token<T: Into<String>>(self, v: T) -> Self
Sets the value of hugging_face_access_token.
§Example
let x = ModelConfig::new().set_hugging_face_access_token("example");Sourcepub fn set_hugging_face_cache_enabled<T: Into<bool>>(self, v: T) -> Self
pub fn set_hugging_face_cache_enabled<T: Into<bool>>(self, v: T) -> Self
Sets the value of hugging_face_cache_enabled.
§Example
let x = ModelConfig::new().set_hugging_face_cache_enabled(true);Sourcepub fn set_model_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_model_display_name<T: Into<String>>(self, v: T) -> Self
Sets the value of model_display_name.
§Example
let x = ModelConfig::new().set_model_display_name("example");Sourcepub fn set_container_spec<T>(self, v: T) -> Selfwhere
T: Into<ModelContainerSpec>,
pub fn set_container_spec<T>(self, v: T) -> Selfwhere
T: Into<ModelContainerSpec>,
Sets the value of container_spec.
§Example
use google_cloud_aiplatform_v1::model::ModelContainerSpec;
let x = ModelConfig::new().set_container_spec(ModelContainerSpec::default()/* use setters */);Sourcepub fn set_or_clear_container_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<ModelContainerSpec>,
pub fn set_or_clear_container_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<ModelContainerSpec>,
Sets or clears the value of container_spec.
§Example
use google_cloud_aiplatform_v1::model::ModelContainerSpec;
let x = ModelConfig::new().set_or_clear_container_spec(Some(ModelContainerSpec::default()/* use setters */));
let x = ModelConfig::new().set_or_clear_container_spec(None::<ModelContainerSpec>);Sourcepub fn set_model_user_id<T: Into<String>>(self, v: T) -> Self
pub fn set_model_user_id<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more