pub struct ModelUpload {
pub name: String,
pub path: Option<String>,
pub data: Option<Vec<u8>>,
pub runtime: Option<String>,
pub input_schema: Option<BTreeMap<String, String>>,
pub output_schema: Option<BTreeMap<String, String>>,
}Expand description
B-112 — describes a model upload to ModelsResource::upload.
Supply the model bytes either by file path (read at upload time) or as
raw data. Exactly one of the two must be set — ModelsResource::upload
returns a PulseError::InvalidConfig otherwise.
Fields§
§name: StringModel name referenced by ml_predict(model = ...).
path: Option<String>Filesystem path to the .onnx file. Mutually exclusive with data.
data: Option<Vec<u8>>Raw model bytes. Mutually exclusive with path.
runtime: Option<String>Model runtime — only "onnx" is supported today. Defaults to "onnx".
input_schema: Option<BTreeMap<String, String>>Ordered feature-name → type map, used to pack features into the input tensor (in the model’s input order).
output_schema: Option<BTreeMap<String, String>>Output-name → type map (informational).
Implementations§
Source§impl ModelUpload
impl ModelUpload
Sourcepub fn from_path(name: impl Into<String>, path: impl Into<String>) -> Self
pub fn from_path(name: impl Into<String>, path: impl Into<String>) -> Self
Upload from a filesystem path to the .onnx file.
Sourcepub fn runtime(self, runtime: impl Into<String>) -> Self
pub fn runtime(self, runtime: impl Into<String>) -> Self
Override the runtime (default "onnx").
Sourcepub fn input_schema(self, schema: BTreeMap<String, String>) -> Self
pub fn input_schema(self, schema: BTreeMap<String, String>) -> Self
Set the ordered input feature schema.
Sourcepub fn output_schema(self, schema: BTreeMap<String, String>) -> Self
pub fn output_schema(self, schema: BTreeMap<String, String>) -> Self
Set the (informational) output schema.
Trait Implementations§
Source§impl Clone for ModelUpload
impl Clone for ModelUpload
Source§fn clone(&self) -> ModelUpload
fn clone(&self) -> ModelUpload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more