huggingface

package
v0.211.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://huggingface.co"

DefaultBaseURL is the public Hugging Face Hub.

Variables

View Source
var ErrNotCached = errors.New("file not cached and download not allowed")

ErrNotCached reports a file that is missing from the cache while the caller did not allow a download. Callers wrap it with the config key that gates it.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
	HTTP    *http.Client
}

Client downloads repository files. BaseURL and HTTP are overridable in tests.

func NewClient

func NewClient() *Client

NewClient returns a Client for the public Hub.

func (*Client) EnsureFile

func (c *Client) EnsureFile(ctx context.Context, repo Repo, file, dir, label string, allowDownload bool, report func(string)) (string, error)

EnsureFile returns the local path of file inside dir, downloading it from repo when it is missing and allowDownload is true. A missing file with downloads disallowed yields ErrNotCached. label names the file in progress reports (sent to report, nil for none) and errors (e.g. "whisper model").

type Repo

type Repo struct {
	ID       string
	Revision string
}

Repo identifies a model repository on the Hub, e.g. "ggerganov/whisper.cpp". An empty Revision means "main"; set a commit SHA to pin the files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL