Package ai.djl.repository.zoo
Class Criteria.Builder<I,O>
- java.lang.Object
-
- ai.djl.repository.zoo.Criteria.Builder<I,O>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Criteria<I,O>build()Builds aCriteriainstance.Criteria.Builder<I,O>optApplication(Application application)Sets the model application for this criteria.Criteria.Builder<I,O>optArgument(java.lang.String key, java.lang.Object value)Sets the optional model loading argument for this criteria.Criteria.Builder<I,O>optArguments(java.util.Map<java.lang.String,java.lang.Object> arguments)Sets an extra model loading argument for this criteria.Criteria.Builder<I,O>optArtifactId(java.lang.String artifactId)Sets optional artifactId of theModelLoaderfor this criteria.Criteria.Builder<I,O>optBlock(Block block)Sets an optional modelBlockfor this criteria.Criteria.Builder<I,O>optDevice(Device device)Sets theDevicefor this criteria.Criteria.Builder<I,O>optEngine(java.lang.String engine)Sets the engine name for this criteria.Criteria.Builder<I,O>optFilter(java.lang.String key, java.lang.String value)Sets an extra search filter for this criteria.Criteria.Builder<I,O>optFilters(java.util.Map<java.lang.String,java.lang.String> filters)Sets the extra search filters for this criteria.Criteria.Builder<I,O>optGroupId(java.lang.String groupId)Sets optional groupId of theModelZoofor this criteria.Criteria.Builder<I,O>optModelName(java.lang.String modelName)Sets an optional model name for this criteria.Criteria.Builder<I,O>optModelPath(java.nio.file.Path modelPath)Sets the optional model path of theModelLoaderfor this criteria.Criteria.Builder<I,O>optModelUrls(java.lang.String modelUrls)Sets optional model urls of theModelLoaderfor this criteria.Criteria.Builder<I,O>optModelZoo(ModelZoo modelZoo)Sets optionalModelZooof theModelLoaderfor this criteria.Criteria.Builder<I,O>optOption(java.lang.String key, java.lang.String value)Sets the optional model loading option for this criteria.Criteria.Builder<I,O>optOptions(java.util.Map<java.lang.String,java.lang.String> options)Sets the model loading options for this criteria.Criteria.Builder<I,O>optProgress(ai.djl.util.Progress progress)Set the optionalProgress.Criteria.Builder<I,O>optTranslator(Translator<I,O> translator)Sets the optionalTranslatorto override defaultTranslator.Criteria.Builder<I,O>optTranslatorFactory(TranslatorFactory factory)Sets the optionalTranslatorFactoryto override defaultTranslator.<P,Q>
Criteria.Builder<P,Q>setTypes(java.lang.Class<P> inputClass, java.lang.Class<Q> outputClass)Creates a new @{code Builder} class with the specified input and output data type.
-
-
-
Method Detail
-
setTypes
public <P,Q> Criteria.Builder<P,Q> setTypes(java.lang.Class<P> inputClass, java.lang.Class<Q> outputClass)
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
public Criteria.Builder<I,O> optApplication(Application application)
Sets the model application for this criteria.- Parameters:
application- the model application- Returns:
- this
Builder
-
optEngine
public Criteria.Builder<I,O> optEngine(java.lang.String engine)
Sets the engine name for this criteria.- Parameters:
engine- the engine name- Returns:
- this
Builder
-
optDevice
public Criteria.Builder<I,O> optDevice(Device device)
Sets theDevicefor this criteria.- Parameters:
device- theDevicefor the criteria- Returns:
- this
Builder
-
optGroupId
public Criteria.Builder<I,O> optGroupId(java.lang.String groupId)
Sets optional groupId of theModelZoofor this criteria.- Parameters:
groupId- the groupId of theModelZoo- Returns:
- this
Builder
-
optArtifactId
public Criteria.Builder<I,O> optArtifactId(java.lang.String artifactId)
Sets optional artifactId of theModelLoaderfor this criteria.- Parameters:
artifactId- the artifactId of theModelLoader- Returns:
- this
Builder
-
optModelUrls
public Criteria.Builder<I,O> optModelUrls(java.lang.String modelUrls)
Sets optional model urls of theModelLoaderfor this criteria.- Parameters:
modelUrls- the comma delimited url string- Returns:
- this
Builder
-
optModelPath
public Criteria.Builder<I,O> optModelPath(java.nio.file.Path modelPath)
Sets the optional model path of theModelLoaderfor this criteria.- Parameters:
modelPath- the path to the model folder/files- Returns:
- this
Builder
-
optModelZoo
public Criteria.Builder<I,O> optModelZoo(ModelZoo modelZoo)
Sets optionalModelZooof theModelLoaderfor this criteria.- Parameters:
modelZoo- ModelZoo} of theModelLoaderfor this criteria- Returns:
- this
Builder
-
optFilters
public Criteria.Builder<I,O> optFilters(java.util.Map<java.lang.String,java.lang.String> filters)
Sets the extra search filters for this criteria.- Parameters:
filters- the extra search filters- Returns:
- this
Builder
-
optFilter
public Criteria.Builder<I,O> optFilter(java.lang.String key, java.lang.String value)
Sets an extra search filter for this criteria.- Parameters:
key- the search keyvalue- the search value- Returns:
- this
Builder
-
optBlock
public Criteria.Builder<I,O> optBlock(Block block)
Sets an optional modelBlockfor this criteria.- Parameters:
block- optional modelBlockfor this criteria- Returns:
- this
Builder
-
optModelName
public Criteria.Builder<I,O> optModelName(java.lang.String modelName)
Sets an optional model name for this criteria.- Parameters:
modelName- optional model name for this criteria- Returns:
- this
Builder
-
optArguments
public Criteria.Builder<I,O> optArguments(java.util.Map<java.lang.String,java.lang.Object> arguments)
Sets an extra model loading argument for this criteria.- Parameters:
arguments- optional model loading arguments- Returns:
- this
Builder
-
optArgument
public Criteria.Builder<I,O> optArgument(java.lang.String key, java.lang.Object value)
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
public Criteria.Builder<I,O> optOptions(java.util.Map<java.lang.String,java.lang.String> options)
Sets the model loading options for this criteria.- Parameters:
options- the model loading options- Returns:
- this
Builder
-
optOption
public Criteria.Builder<I,O> optOption(java.lang.String key, java.lang.String value)
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
public Criteria.Builder<I,O> optTranslator(Translator<I,O> translator)
Sets the optionalTranslatorto override defaultTranslator.- Parameters:
translator- the overrideTranslator- Returns:
- this
Builder
-
optTranslatorFactory
public Criteria.Builder<I,O> optTranslatorFactory(TranslatorFactory factory)
Sets the optionalTranslatorFactoryto override defaultTranslator.- Parameters:
factory- the overrideTranslatorFactory- Returns:
- this
Builder
-
optProgress
public Criteria.Builder<I,O> optProgress(ai.djl.util.Progress progress)
Set the optionalProgress.- Parameters:
progress- theProgress- Returns:
- this
Builder
-
-