Package ai.vespa.models.evaluation
Class ModelsEvaluator
java.lang.Object
com.yahoo.component.AbstractComponent
ai.vespa.models.evaluation.ModelsEvaluator
- All Implemented Interfaces:
com.yahoo.component.Component,com.yahoo.component.Deconstructable,Comparable<com.yahoo.component.Component>
public class ModelsEvaluator
extends com.yahoo.component.AbstractComponent
Evaluates machine-learned models added to Vespa applications and available as config form.
Usage:
Tensor result = evaluator.bind("foo", value).bind("bar", value").evaluate()- Author:
- bratseth
-
Field Summary
Fields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable -
Constructor Summary
ConstructorsConstructorDescriptionModelsEvaluator(RankProfilesConfigImporter importer, com.yahoo.vespa.config.search.RankProfilesConfig config, com.yahoo.vespa.config.search.core.RankingConstantsConfig constantsConfig, com.yahoo.vespa.config.search.core.RankingExpressionsConfig expressionsConfig, com.yahoo.vespa.config.search.core.OnnxModelsConfig onnxModelsConfig) ModelsEvaluator(com.yahoo.vespa.config.search.RankProfilesConfig config, com.yahoo.vespa.config.search.core.RankingConstantsConfig constantsConfig, com.yahoo.vespa.config.search.core.RankingExpressionsConfig expressionsConfig, com.yahoo.vespa.config.search.core.OnnxModelsConfig onnxModelsConfig, com.yahoo.filedistribution.fileacquirer.FileAcquirer fileAcquirer) ModelsEvaluator(com.yahoo.vespa.config.search.RankProfilesConfig config, com.yahoo.vespa.config.search.core.RankingConstantsConfig constantsConfig, com.yahoo.vespa.config.search.core.RankingExpressionsConfig expressionsConfig, com.yahoo.vespa.config.search.core.OnnxModelsConfig onnxModelsConfig, com.yahoo.filedistribution.fileacquirer.FileAcquirer fileAcquirer, ai.vespa.modelintegration.evaluator.OnnxRuntime onnx) ModelsEvaluator(Map<String, Model> models) -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluatorOf(String modelName, String... names) Returns a function which can be used to evaluate the given function in the given modelmodels()Returns the models of this as an immutable maprequireModel(String name) Returns the given model, or throws a IllegalArgumentException if it does not existMethods inherited from class com.yahoo.component.AbstractComponent
clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Constructor Details
-
ModelsEvaluator
@Inject public ModelsEvaluator(com.yahoo.vespa.config.search.RankProfilesConfig config, com.yahoo.vespa.config.search.core.RankingConstantsConfig constantsConfig, com.yahoo.vespa.config.search.core.RankingExpressionsConfig expressionsConfig, com.yahoo.vespa.config.search.core.OnnxModelsConfig onnxModelsConfig, com.yahoo.filedistribution.fileacquirer.FileAcquirer fileAcquirer, ai.vespa.modelintegration.evaluator.OnnxRuntime onnx) -
ModelsEvaluator
public ModelsEvaluator(com.yahoo.vespa.config.search.RankProfilesConfig config, com.yahoo.vespa.config.search.core.RankingConstantsConfig constantsConfig, com.yahoo.vespa.config.search.core.RankingExpressionsConfig expressionsConfig, com.yahoo.vespa.config.search.core.OnnxModelsConfig onnxModelsConfig, com.yahoo.filedistribution.fileacquirer.FileAcquirer fileAcquirer) -
ModelsEvaluator
public ModelsEvaluator(RankProfilesConfigImporter importer, com.yahoo.vespa.config.search.RankProfilesConfig config, com.yahoo.vespa.config.search.core.RankingConstantsConfig constantsConfig, com.yahoo.vespa.config.search.core.RankingExpressionsConfig expressionsConfig, com.yahoo.vespa.config.search.core.OnnxModelsConfig onnxModelsConfig) -
ModelsEvaluator
-
-
Method Details
-
models
Returns the models of this as an immutable map -
evaluatorOf
Returns a function which can be used to evaluate the given function in the given model- Parameters:
modelName- the name of the modelnames- the 0-2 name components identifying the output to compute- Throws:
IllegalArgumentException- if the function or model is not present
-
requireModel
Returns the given model, or throws a IllegalArgumentException if it does not exist -
deconstruct
public void deconstruct()- Specified by:
deconstructin interfacecom.yahoo.component.Deconstructable- Overrides:
deconstructin classcom.yahoo.component.AbstractComponent
-