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 protectedModelThread(ai.djl.Device device)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the thread type and frees any resources.ai.djl.inference.Predictor<I,O>getPredictor()Returns the predictor.voidrun(java.util.List<Job<I,O>> jobs)Runs the work on theWorkerThreadand 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.ThreadConfigRuns the work on theWorkerThreadand stores in the job.- Specified by:
runin 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:
closein classWorkerPoolConfig.ThreadConfig<I,O>
-
-