MLBin

Struct MLBin 

Source
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: PathBuf

The absolute path to the root of the ML-cellar storage.

§rack_name: PathBuf

The name (relative directory path) of the rack.

§project_name: PathBuf

The name (relative directory path) of the project.

§version: String

The version of the project.

Implementations§

Source§

impl MLBin

Source

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 storage
  • rack_name - The name (relative directory path) of the rack
  • project_name - The name (relative directory path) of the project
  • version - The version string of the model
Source

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-cellar
  • rack_directory - The absolute path to the directory of the rack
Source

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}

Auto Trait Implementations§

§

impl Freeze for MLBin

§

impl RefUnwindSafe for MLBin

§

impl Send for MLBin

§

impl Sync for MLBin

§

impl Unpin for MLBin

§

impl UnwindSafe for MLBin

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.