Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Distribution::ModelResolver Class Referenceexport

Pulls a published model into the store. More...

Public Member Functions

 ModelResolver (ModelStore &store, const IModelHub &hub)
StoredModel pull (const ModelCoordinate &coordinate)
 Pull an explicit coordinate, writing its record on success.
StoredModel pull (const std::string &name, const std::string &owner)
 Pull a model by name.

Detailed Description

Pulls a published model into the store.

Pull and load are separate verbs: this is the only thing that touches a hub, and what it leaves behind is a store record that every later operation reads.

Member Function Documentation

◆ pull() [1/2]

StoredModel Mila::Distribution::ModelResolver::pull ( const ModelCoordinate & coordinate)
inline

Pull an explicit coordinate, writing its record on success.

The record is keyed by the repository name alone – the owner is provenance, kept in the record and never in the path, so what a user types to pull is what they type to load.

The record is written last. Until every blob has verified there is nothing worth recording, and a record naming a blob that never arrived would make a broken model look installed.

◆ pull() [2/2]

StoredModel Mila::Distribution::ModelResolver::pull ( const std::string & name,
const std::string & owner )
inline

Pull a model by name.

The name is all a user gives: the hub and the owner are supplied by the caller, because a store that serves one publisher makes them a constant rather than a decision. A path is refused – installing is the operation that takes one, and a load reads only the store, where an undescribed file is a model nothing knows the quantization, the architecture or the integrity of.

Exceptions
std::runtime_errorif the name is path-shaped, if the manifest is malformed, or if the artifact requires a newer Mila.

The documentation for this class was generated from the following file: