Package ai.djl.repository.zoo
Class Criteria.Builder<I,O>
java.lang.Object
ai.djl.repository.zoo.Criteria.Builder<I,O>
A Builder to construct a
Criteria
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aCriteria
instance.optApplication
(Application application) Sets the model application for this criteria.optArgument
(String key, Object value) Sets the optional model loading argument for this criteria.optArguments
(Map<String, Object> arguments) Sets an extra model loading argument for this criteria.optArtifactId
(String artifactId) Sets optional artifactId of theModelLoader
for this criteria.Sets an optional modelBlock
for this criteria.Sets theDevice
for this criteria.Sets the engine name for this criteria.Sets an extra search filter for this criteria.optFilters
(Map<String, String> filters) Sets the extra search filters for this criteria.optGroupId
(String groupId) Sets optional groupId of theModelZoo
for this criteria.optModelName
(String modelName) Sets an optional model name for this criteria.optModelPath
(Path modelPath) Sets the optional model path of theModelLoader
for this criteria.optModelUrls
(String modelUrls) Sets optional model urls of theModelLoader
for this criteria.optModelZoo
(ModelZoo modelZoo) Sets optionalModelZoo
of theModelLoader
for this criteria.Sets the optional model loading option for this criteria.optOptions
(Map<String, String> options) Sets the model loading options for this criteria.optProgress
(ai.djl.util.Progress progress) Set the optionalProgress
.optTranslator
(Translator<I, O> translator) Sets the optionalTranslator
to override defaultTranslator
.optTranslatorFactory
(TranslatorFactory factory) Sets the optionalTranslatorFactory
to override defaultTranslator
.<P,
Q> Criteria.Builder<P, Q> Creates a new @{code Builder} class with the specified input and output data type.
-
Method Details
-
setTypes
Creates a new @{code Builder} class with the specified input and output data type.- Type Parameters:
P
- the input data typeQ
- the output data type- Parameters:
inputClass
- the input classoutputClass
- the output class- Returns:
- a new @{code Builder} class with the specified input and output data type
-
optApplication
Sets the model application for this criteria.- Parameters:
application
- the model application- Returns:
- this
Builder
-
optEngine
Sets the engine name for this criteria.- Parameters:
engine
- the engine name- Returns:
- this
Builder
-
optDevice
Sets theDevice
for this criteria.- Parameters:
device
- theDevice
for the criteria- Returns:
- this
Builder
-
optGroupId
Sets optional groupId of theModelZoo
for this criteria.- Parameters:
groupId
- the groupId of theModelZoo
- Returns:
- this
Builder
-
optArtifactId
Sets optional artifactId of theModelLoader
for this criteria.- Parameters:
artifactId
- the artifactId of theModelLoader
- Returns:
- this
Builder
-
optModelUrls
Sets optional model urls of theModelLoader
for this criteria.- Parameters:
modelUrls
- the comma delimited url string- Returns:
- this
Builder
-
optModelPath
Sets the optional model path of theModelLoader
for this criteria.- Parameters:
modelPath
- the path to the model folder/files- Returns:
- this
Builder
-
optModelZoo
Sets optionalModelZoo
of theModelLoader
for this criteria.- Parameters:
modelZoo
- ModelZoo} of theModelLoader
for this criteria- Returns:
- this
Builder
-
optFilters
Sets the extra search filters for this criteria.- Parameters:
filters
- the extra search filters- Returns:
- this
Builder
-
optFilter
Sets an extra search filter for this criteria.- Parameters:
key
- the search keyvalue
- the search value- Returns:
- this
Builder
-
optBlock
Sets an optional modelBlock
for this criteria.- Parameters:
block
- optional modelBlock
for this criteria- Returns:
- this
Builder
-
optModelName
Sets an optional model name for this criteria.- Parameters:
modelName
- optional model name for this criteria- Returns:
- this
Builder
-
optArguments
Sets an extra model loading argument for this criteria.- Parameters:
arguments
- optional model loading arguments- Returns:
- this
Builder
-
optArgument
Sets the optional model loading argument for this criteria.- Parameters:
key
- the model loading argument keyvalue
- the model loading argument value- Returns:
- this
Builder
-
optOptions
Sets the model loading options for this criteria.- Parameters:
options
- the model loading options- Returns:
- this
Builder
-
optOption
Sets the optional model loading option for this criteria.- Parameters:
key
- the model loading option keyvalue
- the model loading option value- Returns:
- this
Builder
-
optTranslator
Sets the optionalTranslator
to override defaultTranslator
.- Parameters:
translator
- the overrideTranslator
- Returns:
- this
Builder
-
optTranslatorFactory
Sets the optionalTranslatorFactory
to override defaultTranslator
.- Parameters:
factory
- the overrideTranslatorFactory
- Returns:
- this
Builder
-
optProgress
Set the optionalProgress
.- Parameters:
progress
- theProgress
- Returns:
- this
Builder
-
build
Builds aCriteria
instance.- Returns:
- the
Criteria
instance
-