Documentation
¶
Overview ¶
Package huggingface owns the current Machine Learning layout used by Hugging Face model and dataset repositories.
Index ¶
- func DeferReindex(ctx context.Context) context.Context
- func FilePath(s string) bool
- func IsXetPath(path string) bool
- func RefName(s string) bool
- func RefPath(id Identity, name string) (string, bool)
- func Revision(s string) bool
- func Serves(t repo.PackageType) bool
- func SnapshotPath(id Identity, revision, file string) (string, bool)
- func ValidXetPath(path string) bool
- func XetWrite(ctx context.Context) context.Context
- type Handler
- func (Handler) Admit(ctx context.Context, _ format.Env, c repo.Config, w format.Write) (format.Write, error)
- func (Handler) Classify(_ repo.Config, path string) format.Class
- func (h Handler) Deleted(ctx context.Context, env format.Env, c repo.Config, removed []types.Item) error
- func (Handler) Deleting(context.Context, format.Env, repo.Config, types.Item) error
- func (h Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error
- func (Handler) GuardTransferSource(_ context.Context, _ format.Env, _ repo.Config, it types.Item) error
- func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error
- func (Handler) Resolve(_ context.Context, _ format.Env, _ repo.Config, d format.Download) (string, error)
- type Identity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeferReindex ¶
DeferReindex lets a native multi-file commit publish its snapshot before rebuilding the package index once inside the same transaction.
func FilePath ¶
FilePath refuses traversal and control characters while preserving valid Unicode filenames used by model repositories.
func RefName ¶
RefName is the documented branch/tag grammar. A ref points to an immutable full revision; its name is never interpreted as a filesystem traversal.
func Revision ¶
Revision accepts immutable full commit IDs. main is a mutable ref resolved before a snapshot path is built. The wire permits a branch or tag name, but only a published ref is resolved; it is never treated as a file-system path.
func Serves ¶
func Serves(t repo.PackageType) bool
func SnapshotPath ¶
SnapshotPath returns the canonical item path for one file.
func ValidXetPath ¶
Types ¶
type Handler ¶
func (Handler) GuardTransferSource ¶
type Identity ¶
type Identity struct {
Kind, Owner, Name string
}
Identity is one model or dataset in the current ML layout.
func ParseIdentity ¶
ParseIdentity accepts the names documented for Artifactory's Hugging Face repositories. A model and a dataset with the same Hub ID stay disjoint.
func ParseSnapshotPath ¶
ParseSnapshotPath is shared by the format hook, native client routes and lifecycle reindex. It never accepts the superseded legacy layout.