Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
ModelCoordinate.ixx File Reference

How a hub repository is addressed: [hf:]<owner>/<repository>[@<revision>]. More...

#include <optional>
#include <string>
#include <string_view>

Classes

struct  Mila::Distribution::ModelCoordinate
 Where a repository lives on a hub. More...

Namespaces

namespace  Mila
 Mila main API namespace.

Functions

std::optional< ModelCoordinateMila::Distribution::parseCoordinate (std::string_view spec)
 Parse a coordinate, or return nothing if the spec is not one.

Variables

constexpr std::string_view Mila::Distribution::kDefaultHubOwner = "mila-llm"
 The owner Mila's published models live under.

Detailed Description

How a hub repository is addressed: [hf:]<owner>/<repository>[@<revision>].

This is the fetch grammar, not the store's. A model is named by a single flat name; the owner is provenance that a consumer supplies and a user never types. Always compiled, because naming a model is not a network operation. See Specifications/ModelDistribution.md.

Function Documentation

◆ parseCoordinate()

std::optional< ModelCoordinate > Mila::Distribution::parseCoordinate ( std::string_view spec)
export

Parse a coordinate, or return nothing if the spec is not one.

Grammar: [hf:]<organization>/<repository>[@<revision>], where organization and repository allow only characters HuggingFace permits in a namespace. Anything path-shaped is rejected on purpose, so a mistyped path reads as a path mistake rather than as a request against a repository that does not exist.

Variable Documentation

◆ kDefaultHubOwner

std::string_view Mila::Distribution::kDefaultHubOwner = "mila-llm"
inlineconstexprexport

The owner Mila's published models live under.

A default a consumer passes to the hub, not something the hub class knows: the hub is "HuggingFace", the owner is Mila's, and baking the second into the first would make the implementation Mila-specific and defeat the interface it sits behind.