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 ¶
Client downloads repository files. BaseURL and HTTP are overridable in tests.
func (*Client) EnsureFile ¶
func (c *Client) EnsureFile(ctx context.Context, repo Repo, file, dir, label string, allowDownload bool) (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 and errors (e.g. "whisper model").
Click to show internal directories.
Click to hide internal directories.