Documentation
¶
Index ¶
Constants ¶
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.