config

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatcherConfigFile added in v0.13.0

type BatcherConfigFile struct {
	config.BatcherConfig

	BatchWaitMicros int
}

BatcherConfigFile provides a Microsecond level override for BatchWait.

func (*BatcherConfigFile) Init added in v0.13.0

func (b *BatcherConfigFile) Init()

type DictionaryMeta added in v0.2.0

type DictionaryMeta struct {
	Hash     int
	Reloaded time.Time
	Error    string
}

DictionaryMeta is used to confirm proper reloading of model components

type Model

type Model struct {
	ID    string
	Debug bool

	// Location is the path the model will be copied to.
	Location string `json:",omitempty" yaml:",omitempty"`

	// Dir is used to build a Location if Location is not provided.
	// The build Location will use Dir directory after os.TempDir() and ID.
	Dir string

	URL string

	Batch *BatcherConfigFile `json:",omitempty" yaml:",omitempty"`

	// Tags is used when loading the Savedmodel.
	// Defaults to []string{"serve"}.
	Tags []string

	// UseDict enables caching and replacing OOV values as "[UNK]" in cache key.
	// If UseDict is nil, defaults to true.
	UseDict *bool `json:",omitempty" yaml:",omitempty"`

	DictURL string // Deprecated: we usually extract the dictionary/vocabulary from TF graph

	shared.MetaInput `json:",omitempty" yaml:",inline"`

	// Deprecated: we can infer output types from TF graph, and there may be more than one output
	OutputType string `json:",omitempty" yaml:",omitempty"`

	Transformer string `json:",omitempty" yaml:",omitempty"`

	// caching
	DataStore string `json:",omitempty" yaml:",omitempty"`

	// Stream is a github.com/viant/tapper configuration.
	// All requests are eligible to be logged.
	Stream *config.Stream `json:",omitempty" yaml:",omitempty"`

	// Modified shows the state of the model files.
	Modified *Modified `json:",omitempty" yaml:",omitempty"`

	DictMeta DictionaryMeta

	Test TestPayload `json:",omitempty" yaml:",omitempty"`
}

Model represents model config

func (*Model) Init

func (m *Model) Init(globalBatchConfig *batchconfig.BatcherConfig)

Init initialises model config

func (Model) UseDictionary

func (m Model) UseDictionary() bool

UseDictionary returns true if dictionary can be used

func (*Model) Validate

func (m *Model) Validate() error

Validate validates model config

type ModelList

type ModelList struct {
	Models []*Model
}

ModelList represents model

func (*ModelList) Init

func (l *ModelList) Init(bc *config.BatcherConfig)

Init initialises model list

func (*ModelList) Validate

func (l *ModelList) Validate() error

Validate validates model list

type Modified

type Modified struct {
	Min time.Time
	Max time.Time
}

Modified represents modified folder

func (*Modified) Span

func (r *Modified) Span() time.Duration

type TestPayload added in v0.6.0

type TestPayload struct {
	Test        bool // if all blank, do a non-batch test
	Single      map[string]interface{}
	SingleBatch bool // only relevant with Single or blank
	Batch       map[string][]interface{}
}

Jump to

Keyboard shortcuts

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