huggingface

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

func NewConverter(modelsPath, modelName string) *Converter

NewConverter creates a new Converter.

func (*Converter) Convert

func (c *Converter) Convert() error

Convert converts the pickle-serialized model to spaGO.

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.

Jump to

Keyboard shortcuts

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