Class ModelInfo.ModelThread

java.lang.Object
ai.djl.serving.wlm.WorkerPoolConfig.ThreadConfig<I,O>
ai.djl.serving.wlm.ModelInfo.ModelThread
Enclosing class:
ModelInfo<I,O>

protected class ModelInfo.ModelThread extends WorkerPoolConfig.ThreadConfig<I,O>
  • Constructor Details

    • ModelThread

      protected ModelThread(ai.djl.Device device)
  • Method Details

    • run

      public void run(List<Job<I,O>> jobs) throws ai.djl.translate.TranslateException
      Description copied from class: WorkerPoolConfig.ThreadConfig
      Runs the work on the WorkerThread and stores in the job.
      Specified by:
      run in class WorkerPoolConfig.ThreadConfig<I,O>
      Parameters:
      jobs - the work input
      Throws:
      ai.djl.translate.TranslateException - if it failed to compute
    • getPredictor

      public ai.djl.inference.Predictor<I,O> getPredictor()
      Returns the predictor.
      Returns:
      the predictor
    • close

      public void close()
      Closes the thread type and frees any resources.
      Specified by:
      close in class WorkerPoolConfig.ThreadConfig<I,O>