Documentation
¶
Index ¶
Constants ¶
const ModelConfigFilename = "config.json"
ModelConfigFilename is the default configuration filename for all Hugging Face pre-trained models.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonModelConfig ¶
type CommonModelConfig struct {
ModelType string `json:"model_type"`
}
CommonModelConfig provides the bare minimum set of model configuration properties which are shared among models of different types.
This is useful when you need to perform different actions depending on the value of certain basic common settings.
For example, the Downloader uses this information to roughly validate the JSON configuration data and to decide how to proceed with further files to download.
func ReadCommonModelConfig ¶
func ReadCommonModelConfig(filename string) (cmc *CommonModelConfig, err error)
ReadCommonModelConfig parses the given JSON config file, returning a new CommonModelConfig value.
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter provides an easy interface for automatically converting supported pre-trained models from huggingface.co repositories.
func NewConverter ¶
NewConverter creates a new Converter.
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader provides an easy interface for automatically downloading supported pre-trained models from huggingface.co repositories.
func NewDownloader ¶
func NewDownloader(modelsPath, modelName string, canOverwrite bool) *Downloader
NewDownloader creates a new Downloader.
func (*Downloader) Download ¶
func (d *Downloader) Download() error
Download downloads all the necessary files for the specified model.