config

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ObjectStore ObjectStoreConfig `yaml:"objectStore"`

	// BaseModels is the list of base models to load. Currently each model follows Hugging Face's model format.
	BaseModels []string `yaml:"baseModels"`

	ModelLoadInterval time.Duration `yaml:"modelLoadInterval"`

	// RunOnce is set to true when models are loaded only once.
	RunOnce bool `yaml:"runOnce"`

	Downloader DownloaderConfig `yaml:"downloader"`

	ModelManagerWorkerServiceServerAddr string `yaml:"modelManagerWorkerServiceServerAddr"`

	Debug DebugConfig `yaml:"debug"`
}

Config is the configuration.

func Parse

func Parse(path string) (Config, error)

Parse parses the configuration file at the given path, returning a new Config struct.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type DebugConfig

type DebugConfig struct {
	Standalone bool `yaml:"standalone"`
}

DebugConfig is the debug configuration.

type DownloaderConfig

type DownloaderConfig struct {
	Kind DownloaderKind `yaml:"kind"`

	HuggingFace HuggingFaceDownloaderConfig `yaml:"huggingFace"`
	S3          S3DownloaderConfig          `yaml:"s3"`
}

DownloaderConfig is the downloader configuration.

type DownloaderKind added in v0.12.0

type DownloaderKind string

DownloaderKind is the downloader kind.

const (
	// DownloaderKindS3 is the S3 downloader kind.
	DownloaderKindS3 DownloaderKind = "s3"
	// DownloaderKindHuggingFace is the Hugging Face downloader kind.
	DownloaderKindHuggingFace DownloaderKind = "huggingFace"
)

type HuggingFaceDownloaderConfig

type HuggingFaceDownloaderConfig struct {
	CacheDir string `yaml:"cacheDir"`
}

HuggingFaceDownloaderConfig is the Hugging Face downloader configuration.

type ObjectStoreConfig

type ObjectStoreConfig struct {
	S3 S3Config `yaml:"s3"`
}

ObjectStoreConfig is the object store configuration.

type S3Config

type S3Config struct {
	EndpointURL string `yaml:"endpointUrl"`
	Region      string `yaml:"region"`

	Bucket string `yaml:"bucket"`

	PathPrefix string `yaml:"pathPrefix"`

	// BaseModelPathPrefix is the path prefix for the base models in the object store. A model is stored under
	// <ObjectStore.S3.PathPrefix>/<BaseModelPathPrefix>.
	BaseModelPathPrefix string `yaml:"baseModelPathPrefix"`
}

S3Config is the S3 configuration.

type S3DownloaderConfig added in v0.12.0

type S3DownloaderConfig struct {
	EndpointURL string `yaml:"endpointUrl"`
	Region      string `yaml:"region"`
	Bucket      string `yaml:"bucket"`
	PathPrefix  string `yaml:"pathPrefix"`
}

S3DownloaderConfig is the S3 downloader configuration.

Jump to

Keyboard shortcuts

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