config

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 string `json:",omitempty" yaml:",omitempty"`
	Dir      string
	URL      string

	Tags []string

	// IO and caching
	UseDict          *bool  `json:",omitempty" yaml:",omitempty"`
	DictURL          string // Deprecated: we usually extract the dictionary/vocabulary from TF graph
	shared.MetaInput `json:",omitempty" yaml:",inline"`
	OutputType       string `json:",omitempty" yaml:",omitempty"` // Deprecated: we can infer output types from TF graph
	Transformer      string `json:",omitempty" yaml:",omitempty"`

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

	// logging
	Stream *config.Stream `json:",omitempty" yaml:",omitempty"`

	// for health and monitoring
	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()

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()

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