inference

package
v0.0.2-0...-058d74b Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InferMgr

type InferMgr struct {
	ResourceVersion
	// contains filtered or unexported fields
}

func (*InferMgr) Rank

func (mgr *InferMgr) Rank(userFeatureJson string, itemIds []string) ([]float32, map[string]string, error)

func (*InferMgr) TickerLoadJob

func (mgr *InferMgr) TickerLoadJob(envCfg config.EnvConfig, jobUtil *utils.MetuxJobUtil,
	smallPoolPath, bigPoolPath, modelPath string)

func (*InferMgr) UserFeatureRows

func (mgr *InferMgr) UserFeatureRows(userFeatureJson string) (string, error)

type Inference

type Inference struct {
	utils.Reference
	Ptr unsafe.Pointer
}

func NewInference

func NewInference(modeFile, modelMeta string) *Inference

func (*Inference) Close

func (w *Inference) Close()

func (*Inference) GetTorchModel

func (w *Inference) GetTorchModel() unsafe.Pointer

func (*Inference) PreProcessUserEmbedding

func (w *Inference) PreProcessUserEmbedding(userFeatureRowsPtr unsafe.Pointer, poolPtr unsafe.Pointer)

func (*Inference) Rank

func (w *Inference) Rank(userFeatureRowsPtr unsafe.Pointer, poolRowsPtr unsafe.Pointer, itemIds []string) []float32

type ModelConfig

type ModelConfig struct {
	Name    string `json:"name" toml:"name" yaml:"name"`
	Path    string `json:"path" toml:"path" yaml:"path" mapstructure:"path"`
	Version string `json:"version" toml:"version" yaml:"version"`
	// contains filtered or unexported fields
}

func ReadModelVersion

func ReadModelVersion(filePath string) (ModelConfig, error)

type PoolConfig

type PoolConfig struct {
	Name    string `json:"name" toml:"name" yaml:"name"`
	Path    string `json:"path" toml:"path" yaml:"path"`
	Version string `json:"version" toml:"version" yaml:"version"`
	// contains filtered or unexported fields
}

func ReadPoolVersion

func ReadPoolVersion(filePath string) (PoolConfig, error)

type PoolRowsCache

type PoolRowsCache struct {
	utils.Reference
	Ptr unsafe.Pointer
}

func NewPoolRowsCache

func NewPoolRowsCache(poolFile, luaFile, lubanFile string, modelPtr unsafe.Pointer) *PoolRowsCache

func (*PoolRowsCache) Close

func (w *PoolRowsCache) Close()

type ResourceVersion

type ResourceVersion struct {
	BigPoolVersion   PoolConfig
	SmallPoolVersion PoolConfig
	ModelVesion      ModelConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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