Documentation ¶
Overview ¶
hub/download.go
Index ¶
Constants ¶
View Source
const ( DownloadChunkSize = 1024 * 1024 // 1MB DefaultRetries = 5 )
View Source
const ( ModelRepoType = "model" SpaceRepoType = "space" DatasetRepoType = "dataset" DefaultRevision = "main" DefaultCacheDir = "~/.cache/huggingface/hub" )
Variables ¶
This section is empty.
Functions ¶
func IsOfflineMode ¶
func IsOfflineMode() bool
Types ¶
type CivitaiSource ¶
type CivitaiSource struct {
// contains filtered or unexported fields
}
func NewCivitaiSource ¶
func NewCivitaiSource(url string, apiKey string) *CivitaiSource
func (*CivitaiSource) Download ¶
func (s *CivitaiSource) Download(destPath string, progress *mpb.Progress) error
func (*CivitaiSource) GetFileInfo ¶
func (s *CivitaiSource) GetFileInfo() (*FileInfo, error)
type Client ¶
type Client struct { Endpoint string Token string CacheDir string UserAgent string Progress *mpb.Progress }
func DefaultClient ¶
func DefaultClient() *Client
type ComponentDef ¶
type DirectURLSource ¶
type DirectURLSource struct {
// contains filtered or unexported fields
}
func NewDirectURLSource ¶
func NewDirectURLSource(url string) *DirectURLSource
func (*DirectURLSource) Download ¶
func (s *DirectURLSource) Download(destPath string, progress *mpb.Progress) error
func (*DirectURLSource) GetFileInfo ¶
func (s *DirectURLSource) GetFileInfo() (*FileInfo, error)
type DownloadParams ¶
type DownloadSource ¶
type FileMetadata ¶
type LFSPointer ¶
type ModelInfo ¶
type ModelInfo struct { Sha string `json:"sha"` Files []string `json:"files"` Siblings []ModelSibling `json:"siblings"` }
type ModelSibling ¶
type ModelSibling struct {
RFileName string `json:"rfilename"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.