Package ai.djl.serving.wlm
Class ModelInfo.ModelThread
- java.lang.Object
-
- ai.djl.serving.wlm.WorkerPoolConfig.ThreadConfig<I,O>
-
- ai.djl.serving.wlm.ModelInfo.ModelThread
-
protected class ModelInfo.ModelThread extends WorkerPoolConfig.ThreadConfig<I,O>
-
-
Field Summary
-
Fields inherited from class ai.djl.serving.wlm.WorkerPoolConfig.ThreadConfig
configJobs
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelThread(ai.djl.Device device)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the thread type and frees any resources.ai.djl.inference.Predictor<I,O>
getPredictor()
Returns the predictor.void
run(java.util.List<Job<I,O>> jobs)
Runs the work on theWorkerThread
and stores in the job.-
Methods inherited from class ai.djl.serving.wlm.WorkerPoolConfig.ThreadConfig
getConfigJobs
-
-
-
-
Method Detail
-
run
public void run(java.util.List<Job<I,O>> jobs) throws ai.djl.translate.TranslateException
Description copied from class:WorkerPoolConfig.ThreadConfig
Runs the work on theWorkerThread
and stores in the job.- Specified by:
run
in classWorkerPoolConfig.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 classWorkerPoolConfig.ThreadConfig<I,O>
-
-