Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Downloaded ¶ added in v0.262.0
type Downloaded struct {
ID string `json:"id"`
Path string `json:"path"`
Files int `json:"files"`
Bytes int64 `json:"bytes"`
}
Downloaded is a Hub repository in the library: where its files are and how much of it is on disk.
func Download ¶ added in v0.262.0
func Download(ctx context.Context, hub *huggingface.Client, dir, id string, only []string, report func(string)) (Downloaded, error)
Download fetches the repository id from the Hub into dir and returns what is on disk afterwards. only names the files to fetch, all of them when empty. A file that is already there is kept, so a stopped download resumes per file.
func List ¶ added in v0.262.0
func List(dir string) ([]Downloaded, error)
List returns every repository in dir that holds at least one file, sorted by id. A missing library is an empty one.