agent

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: NCSA Imports: 39 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// Sometimes put fail with too many connection, we want to retry
	PutRetryMax = 5

	// Rest for some time interval before we retry
	PutRetrySleep = 20 * time.Millisecond
)

Variables

View Source
var (
	DefaultChannelBuffer = 1000
)

Functions

func AddPredictor

func AddPredictor(framework dl.FrameworkManifest, pred predictor.Predictor) error

func GetPredictor

func GetPredictor(framework dl.FrameworkManifest) (predictor.Predictor, error)

func GetPredictors added in v0.3.0

func GetPredictors(framework dl.FrameworkManifest) ([]predictor.Predictor, error)

func PredictorFrameworks added in v0.2.19

func PredictorFrameworks() []dl.FrameworkManifest

func Predictors

func Predictors() []string

func UploadDir

func UploadDir() (string, error)

Types

type Agent

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

func New

func New(predictors []predictor.Predictor, opts ...Option) (*Agent, error)

func (*Agent) Close added in v0.2.16

Close a predictor and clear it's memory.

func (*Agent) Dataset added in v0.2.16

func (p *Agent) Dataset(ctx context.Context, req *dl.DatasetRequest) (*dl.FeaturesResponse, error)

Dataset method receives a single dataset and runs the predictor on all elements of the dataset. The result is a prediction feature list.

func (*Agent) FindFrameworkModel

func (p *Agent) FindFrameworkModel(ctx context.Context, req *dl.PredictorOpenRequest) (*dl.FrameworkManifest, *dl.ModelManifest, error)

func (*Agent) Images added in v0.2.16

func (p *Agent) Images(ctx context.Context, req *dl.ImagesRequest) (*dl.FeaturesResponse, error)

Image method receives a list base64 encoded images and runs the predictor on all the images. The result is a prediction feature list for each image.

func (*Agent) Open added in v0.2.16

func (p *Agent) Open(ctx context.Context, req *dl.PredictorOpenRequest) (*dl.Predictor, error)

Opens a predictor and returns an id where the predictor is accessible. The id can be used to perform inference requests.

func (*Agent) PublishInPredictor added in v0.2.16

func (b *Agent) PublishInPredictor(host, prefix string) error

func (*Agent) PublishInRegistery added in v0.2.16

func (b *Agent) PublishInRegistery(prefix string) error

func (*Agent) RegisterManifests

func (p *Agent) RegisterManifests() (*grpc.Server, error)

func (*Agent) RegisterPredictor

func (p *Agent) RegisterPredictor() (*grpc.Server, error)

func (*Agent) Reset added in v0.2.16

func (p *Agent) Reset(ctx context.Context, req *dl.ResetRequest) (*dl.ResetResponse, error)

Clear method clears the internal cache of the predictors

func (*Agent) URLs added in v0.2.16

func (p *Agent) URLs(ctx context.Context, req *dl.URLsRequest) (*dl.FeaturesResponse, error)

URLs method receives a list of urls and runs the predictor on all the urls. The result is a list of predicted features for all the urls.

type Option

type Option func(o *Options) *Options

func WithHost

func WithHost(host string) Option

func WithPort

func WithPort(port int) Option

func WithPortString added in v0.2.16

func WithPortString(port string) Option

type Options

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

func NewOptions

func NewOptions(opts ...Option) (*Options, error)

type PredictorLifetime added in v0.3.0

type PredictorLifetime struct {
	Predictor      *predictor.Predictor
	ReferenceCount uint64
}

type Registry

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

func (*Registry) FrameworkAgents

func (c *Registry) FrameworkAgents(context.Context, *dl.FrameworkRequest) (*dl.Agents, error)

func (*Registry) FrameworkManifests

func (*Registry) ModelAgents

func (c *Registry) ModelAgents(context.Context, *dl.ModelRequest) (*dl.Agents, error)

func (*Registry) ModelManifests

func (*Registry) PublishInPredictor added in v0.2.16

func (b *Registry) PublishInPredictor(host, prefix string) error

func (*Registry) PublishInRegistery

func (c *Registry) PublishInRegistery() error

Jump to

Keyboard shortcuts

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