Documentation
¶
Index ¶
- func HasInputComponent(schema *openapi3.T, isTrain bool) bool
- func ValidateInputMapForMode(input map[string]any, schema *openapi3.T, isTrain bool) error
- func ValidateInputNamesForMode(input map[string]any, schema *openapi3.T, isTrain bool) error
- func ValidateInputsForMode(inputs Inputs, schema *openapi3.T, isTrain bool) error
- type HealthcheckResponse
- type HelpResponse
- type Input
- type Inputs
- type Predictor
- type PredictorOptions
- type Request
- type RequestContext
- type Response
- type ValidationErrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasInputComponent ¶ added in v0.22.0
HasInputComponent reports whether the schema has the Input (or TrainingInput) component needed by preflight validation, so callers can fall back to the runtime schema for images with minimal or missing labels.
func ValidateInputMapForMode ¶ added in v0.22.0
ValidateInputMapForMode validates an already JSON-shaped input map.
func ValidateInputNamesForMode ¶ added in v0.22.0
ValidateInputNamesForMode validates top-level input names without reading or converting values.
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 Predictor ¶
type Predictor struct {
// contains filtered or unexported fields
}
func NewPredictor ¶
func NewPredictor(_ context.Context, opts PredictorOptions) (*Predictor, error)
NewPredictor constructs a Predictor. See PredictorOptions for the meaning of each field.
func (*Predictor) Predict ¶
func (p *Predictor) Predict(inputs Inputs, context RequestContext) (*Response, error)
type PredictorOptions ¶ added in v0.19.3
type PredictorOptions struct {
RunOptions command.RunOptions
IsTrain bool
Docker command.Command
WeightManager *weights.Manager
}
PredictorOptions configures a Predictor.
RunOptions carries everything the user supplied (image, volumes, env, GPUs, ports). If WeightManager is non-nil, Predictor.Start will call Prepare and merge the resulting read-only mounts into RunOptions.Volumes before launching the container; Stop will Release them afterwards. A nil WeightManager preserves the historical behavior for callers that don't deal with managed weights.
type Request ¶ added in v0.1.0
type Request struct {
// TODO: could this be Inputs?
Input map[string]any `json:"input"`
Context RequestContext `json:"context"`
}
type RequestContext ¶ added in v0.15.1
type RequestContext struct {
ReplicateAPIToken string `json:"replicate_api_token,omitempty"`
}