loader

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeModelClient added in v0.16.0

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

FakeModelClient is a fake model client.

func NewFakeModelClient added in v0.16.0

func NewFakeModelClient() *FakeModelClient

NewFakeModelClient creates a fake model client.

func (*FakeModelClient) CreateBaseModel added in v0.16.0

func (c *FakeModelClient) CreateBaseModel(ctx context.Context, in *mv1.CreateBaseModelRequest, opts ...grpc.CallOption) (*mv1.BaseModel, error)

CreateBaseModel creates a base model.

func (*FakeModelClient) GetBaseModelPath added in v0.16.0

GetBaseModelPath gets the path of a base model.

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(
	baseModels []string,
	objectStorPathPrefix string,
	modelDownloader ModelDownloader,
	s3Client S3Client,
	modelClient ModelClient,
) *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 ModelClient added in v0.16.0

type ModelClient interface {
	CreateBaseModel(ctx context.Context, in *mv1.CreateBaseModelRequest, opts ...grpc.CallOption) (*mv1.BaseModel, error)
	GetBaseModelPath(ctx context.Context, in *mv1.GetBaseModelPathRequest, opts ...grpc.CallOption) (*mv1.GetBaseModelPathResponse, error)
}

ModelClient is an interface for the model client.

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.

type S3Downloader added in v0.12.0

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

S3Downloader downloads models from S3.

func NewS3Downloader added in v0.12.0

func NewS3Downloader(s3Client s3Client, pathPrefix string) *S3Downloader

NewS3Downloader returns a new S3Downloader.

Jump to

Keyboard shortcuts

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