loader

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HuggingFaceDownloader

type HuggingFaceDownloader struct {
	// contains filtered or unexported fields
}

HuggingFaceDownloader downloads models from Hugging Face.

func NewHuggingFaceDownloader

func NewHuggingFaceDownloader(cacheDir string) *HuggingFaceDownloader

NewHuggingFaceDownloader creates a new HuggingFaceDownloader.

type L

type L struct {
	// contains filtered or unexported fields
}

L is a loader.

func New

func New(
	store *store.S,
	baseModels []string,
	objectStorPathPrefix string,
	modelDownloader ModelDownloader,
	s3Client S3Client,
) *L

New creates a new loader.

func (*L) LoadBaseModels added in v0.8.0

func (l *L) LoadBaseModels(ctx context.Context) error

LoadBaseModels loads the base models.

func (*L) Run

func (l *L) Run(ctx context.Context, interval time.Duration) error

Run runs the loader.

type ModelDownloader

type ModelDownloader interface {
	// contains filtered or unexported methods
}

ModelDownloader is an interface for downloading a model.

type NoopModelDownloader

type NoopModelDownloader struct {
}

NoopModelDownloader is a no-op model downloader.

type NoopS3Client

type NoopS3Client struct {
}

NoopS3Client is a no-op S3 client.

func (*NoopS3Client) Upload

func (c *NoopS3Client) Upload(r io.Reader, key string) error

Upload uploads a file to S3.

type S3Client

type S3Client interface {
	Upload(r io.Reader, key string) error
}

S3Client is an interface for uploading a file to S3.

Jump to

Keyboard shortcuts

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