pub struct MLBin {
pub cellar_directory: PathBuf,
pub rack_name: PathBuf,
pub project_name: PathBuf,
pub version: String,
}Expand description
ML-bin is a specific release of a model stored under a rack (e.g., vit-l/1.1/).
ML-bin has artifacts like checkpoints, configs, logs.
It corresponds to a “vintage” in the wine analogy.
ML-bin is expressed as {cellar_directory}/{rack_directory}/{project}/{version}/.
Fields§
§cellar_directory: PathBufThe absolute path to the root of the ML-cellar storage.
rack_name: PathBufThe name (relative directory path) of the rack.
project_name: PathBufThe name (relative directory path) of the project.
version: StringThe version of the project.
Implementations§
Source§impl MLBin
impl MLBin
Sourcepub fn new(
cellar_directory: PathBuf,
rack_name: impl Into<PathBuf>,
project_name: impl Into<PathBuf>,
version: String,
) -> Self
pub fn new( cellar_directory: PathBuf, rack_name: impl Into<PathBuf>, project_name: impl Into<PathBuf>, version: String, ) -> Self
Creates a new MLBin instance.
§Arguments
cellar_directory- The absolute path to the root of the ML-cellar storagerack_name- The name (relative directory path) of the rackproject_name- The name (relative directory path) of the projectversion- The version string of the model
Sourcepub fn from_ml_bin_path(
ml_bin_path: PathBuf,
cellar_directory: PathBuf,
rack_directory: PathBuf,
) -> Self
pub fn from_ml_bin_path( ml_bin_path: PathBuf, cellar_directory: PathBuf, rack_directory: PathBuf, ) -> Self
Creates a new MLBin instance from an ML-bin path.
This method parses the ML-bin path and extracts the rack name, project name, and version by analyzing the directory structure relative to the cellar and rack directories.
§Arguments
ml_bin_path- The path to the ML-bin (can be relative or absolute)cellar_directory- The absolute path to the root directory of the ML-cellarrack_directory- The absolute path to the directory of the rack
Sourcepub fn get_full_path(&self) -> PathBuf
pub fn get_full_path(&self) -> PathBuf
Returns the full absolute path to the ML-bin directory.
Constructs the path by joining: {cellar_directory}/{rack_name}/{project_name}/{version}