predict

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthcheckResponse added in v0.7.0

type HealthcheckResponse struct {
	Status string `json:"status"`
}

type HelpResponse

type HelpResponse struct {
	Arguments map[string]*config.RunArgument `json:"arguments"`
}

type Input

type Input struct {
	String *string
	File   *string
	Array  *[]any
	Json   *json.RawMessage
}

type Inputs

type Inputs map[string]Input

func NewInputs

func NewInputs(keyVals map[string][]string, schema *openapi3.T) (Inputs, error)

func NewInputsWithBaseDir

func NewInputsWithBaseDir(keyVals map[string]string, baseDir string) Inputs

type Predictor

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

func NewPredictor

func NewPredictor(runOptions docker.RunOptions, isTrain bool, fastFlag bool, dockerCommand command.Command) (*Predictor, error)

func (*Predictor) GetSchema added in v0.1.0

func (p *Predictor) GetSchema() (*openapi3.T, error)

func (*Predictor) Predict

func (p *Predictor) Predict(inputs Inputs) (*Response, error)

func (*Predictor) Start

func (p *Predictor) Start(logsWriter io.Writer, timeout time.Duration) error

func (*Predictor) Stop

func (p *Predictor) Stop() error

type Request added in v0.1.0

type Request struct {
	// TODO: could this be Inputs?
	Input map[string]interface{} `json:"input"`
}

type Response added in v0.1.0

type Response struct {
	Status status       `json:"status"`
	Output *interface{} `json:"output"`
	Error  string       `json:"error"`
}

type ValidationErrorResponse added in v0.1.0

type ValidationErrorResponse struct {
	Detail []struct {
		Location []string `json:"loc"`
		Message  string   `json:"msg"`
		Type     string   `json:"type"`
	} `json:"detail"`
}

Jump to

Keyboard shortcuts

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