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 aCriteriainstance.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 theModelLoaderfor this criteria.Sets an optional modelBlockfor this criteria.Sets theDevicefor 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 theModelZoofor this criteria.optModelName(String modelName) Sets an optional model name for this criteria.optModelPath(Path modelPath) Sets the optional model path of theModelLoaderfor this criteria.optModelUrls(String modelUrls) Sets optional model urls of theModelLoaderfor this criteria.optModelZoo(ModelZoo modelZoo) Sets optionalModelZooof theModelLoaderfor 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 optionalTranslatorto override defaultTranslator.optTranslatorFactory(TranslatorFactory factory) Sets the optionalTranslatorFactoryto 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 theDevicefor this criteria.- Parameters:
device- theDevicefor the criteria- Returns:
- this
Builder
-
optGroupId
Sets optional groupId of theModelZoofor this criteria.- Parameters:
groupId- the groupId of theModelZoo- Returns:
- this
Builder
-
optArtifactId
Sets optional artifactId of theModelLoaderfor this criteria.- Parameters:
artifactId- the artifactId of theModelLoader- Returns:
- this
Builder
-
optModelUrls
Sets optional model urls of theModelLoaderfor this criteria.- Parameters:
modelUrls- the comma delimited url string- Returns:
- this
Builder
-
optModelPath
Sets the optional model path of theModelLoaderfor this criteria.- Parameters:
modelPath- the path to the model folder/files- Returns:
- this
Builder
-
optModelZoo
Sets optionalModelZooof theModelLoaderfor this criteria.- Parameters:
modelZoo- ModelZoo} of theModelLoaderfor 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 modelBlockfor this criteria.- Parameters:
block- optional modelBlockfor 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 optionalTranslatorto override defaultTranslator.- Parameters:
translator- the overrideTranslator- Returns:
- this
Builder
-
optTranslatorFactory
Sets the optionalTranslatorFactoryto override defaultTranslator.- Parameters:
factory- the overrideTranslatorFactory- Returns:
- this
Builder
-
optProgress
Set the optionalProgress.- Parameters:
progress- theProgress- Returns:
- this
Builder
-
build
Builds aCriteriainstance.- Returns:
- the
Criteriainstance
-