models

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultModelConfigFilename = "config.json"

DefaultModelConfigFilename is the default configuration filename for all compatible pre-trained model from Hugging Face.

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 model 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 operations of downloading and converting Hugging Face models use this information to roughly validate the JSON configuration data, to read the specific type of model, and then to decide if and how to proceed with further actions (downloading further files, converting the model, ...).

func ReadCommonModelConfig

func ReadCommonModelConfig(modelPath, configFilename string) (conf *CommonModelConfig, err error)

ReadCommonModelConfig parses the main JSON configuration file of a Hugging Face's model, returning a new CommonModelConfig value.

The function accepts the path to the model's directory and the optional name of the configuration file. If configFilename is an empty string, the value of DefaultModelConfigFilename is used instead.

Directories

Path Synopsis
Package bart implements the transformer model introduced by Mike et al., 2019.
Package bart implements the transformer model introduced by Mike et al., 2019.

Jump to

Keyboard shortcuts

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