Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Distribution::IModelHub Class Referenceabstractexport

A remote that serves manifests and files. More...

Inheritance diagram for Mila::Distribution::IModelHub:
Mila::Distribution::HuggingFaceHub

Public Member Functions

virtual FetchReport fetchFile (const ModelCoordinate &coordinate, const std::string &path, uint64_t resume_from, const std::function< bool(const char *, size_t)> &sink) const =0
 Stream one repository file, resuming from an offset.
virtual std::string fetchManifest (const ModelCoordinate &coordinate) const =0
 The raw mila.json text for a coordinate.
virtual std::vector< HubModellistModels (const std::string &owner) const =0
 Every repository an owner publishes.
virtual std::string name () const =0
 Stable identifier recorded in a store record, e.g. "huggingface".

Detailed Description

A remote that serves manifests and files.

Narrow on purpose. What varies between hubs is URL construction, authentication and the listing API; what does not vary is the manifest schema, the digest check, the blob store and the resume protocol. fetchFile takes a resume offset rather than a URL so that a hub which is not HTTP can still satisfy it.

Member Function Documentation

◆ fetchFile()

virtual FetchReport Mila::Distribution::IModelHub::fetchFile ( const ModelCoordinate & coordinate,
const std::string & path,
uint64_t resume_from,
const std::function< bool(const char *, size_t)> & sink ) const
pure virtual

Stream one repository file, resuming from an offset.

Implemented in Mila::Distribution::HuggingFaceHub.

◆ fetchManifest()

virtual std::string Mila::Distribution::IModelHub::fetchManifest ( const ModelCoordinate & coordinate) const
pure virtual

The raw mila.json text for a coordinate.

Implemented in Mila::Distribution::HuggingFaceHub.

◆ listModels()

virtual std::vector< HubModel > Mila::Distribution::IModelHub::listModels ( const std::string & owner) const
pure virtual

Every repository an owner publishes.

The result is untrusted remote text authored by whoever owns the repository. It is data: rendered, never interpreted as markup and never as instructions.

Implemented in Mila::Distribution::HuggingFaceHub.

◆ name()

virtual std::string Mila::Distribution::IModelHub::name ( ) const
pure virtual

Stable identifier recorded in a store record, e.g. "huggingface".

Implemented in Mila::Distribution::HuggingFaceHub.


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