Class Criteria.Builder<I,O>

java.lang.Object
ai.djl.repository.zoo.Criteria.Builder<I,O>
Enclosing class:
Criteria<I,O>

public static final class Criteria.Builder<I,O> extends Object
A Builder to construct a Criteria.
  • Method Details

    • setTypes

      public <P, Q> Criteria.Builder<P,Q> setTypes(Class<P> inputClass, Class<Q> outputClass)
      Creates a new @{code Builder} class with the specified input and output data type.
      Type Parameters:
      P - the input data type
      Q - the output data type
      Parameters:
      inputClass - the input class
      outputClass - 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(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 the Device for this criteria.
      Parameters:
      device - the Device for the criteria
      Returns:
      this Builder
    • optGroupId

      public Criteria.Builder<I,O> optGroupId(String groupId)
      Sets optional groupId of the ModelZoo for this criteria.
      Parameters:
      groupId - the groupId of the ModelZoo
      Returns:
      this Builder
    • optArtifactId

      public Criteria.Builder<I,O> optArtifactId(String artifactId)
      Sets optional artifactId of the ModelLoader for this criteria.
      Parameters:
      artifactId - the artifactId of the ModelLoader
      Returns:
      this Builder
    • optModelUrls

      public Criteria.Builder<I,O> optModelUrls(String modelUrls)
      Sets optional model urls of the ModelLoader for this criteria.
      Parameters:
      modelUrls - the comma delimited url string
      Returns:
      this Builder
    • optModelPath

      public Criteria.Builder<I,O> optModelPath(Path modelPath)
      Sets the optional model path of the ModelLoader for this criteria.
      Parameters:
      modelPath - the path to the model folder/files
      Returns:
      this Builder
    • optModelZoo

      public Criteria.Builder<I,O> optModelZoo(ModelZoo modelZoo)
      Sets optional ModelZoo of the ModelLoader for this criteria.
      Parameters:
      modelZoo - ModelZoo} of the ModelLoader for this criteria
      Returns:
      this Builder
    • optFilters

      public Criteria.Builder<I,O> optFilters(Map<String,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(String key, String value)
      Sets an extra search filter for this criteria.
      Parameters:
      key - the search key
      value - the search value
      Returns:
      this Builder
    • optBlock

      public Criteria.Builder<I,O> optBlock(Block block)
      Sets an optional model Block for this criteria.
      Parameters:
      block - optional model Block for this criteria
      Returns:
      this Builder
    • optModelName

      public Criteria.Builder<I,O> optModelName(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(Map<String,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(String key, Object value)
      Sets the optional model loading argument for this criteria.
      Parameters:
      key - the model loading argument key
      value - the model loading argument value
      Returns:
      this Builder
    • optOptions

      public Criteria.Builder<I,O> optOptions(Map<String,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(String key, String value)
      Sets the optional model loading option for this criteria.
      Parameters:
      key - the model loading option key
      value - the model loading option value
      Returns:
      this Builder
    • optTranslator

      public Criteria.Builder<I,O> optTranslator(Translator<I,O> translator)
      Sets the optional Translator to override default Translator.
      Parameters:
      translator - the override Translator
      Returns:
      this Builder
    • optTranslatorFactory

      public Criteria.Builder<I,O> optTranslatorFactory(TranslatorFactory factory)
      Sets the optional TranslatorFactory to override default Translator.
      Parameters:
      factory - the override TranslatorFactory
      Returns:
      this Builder
    • optProgress

      public Criteria.Builder<I,O> optProgress(ai.djl.util.Progress progress)
      Set the optional Progress.
      Parameters:
      progress - the Progress
      Returns:
      this Builder
    • build

      public Criteria<I,O> build()
      Builds a Criteria instance.
      Returns:
      the Criteria instance