Package ai.djl.spring.configuration
Class DjlAutoConfiguration
- java.lang.Object
-
- ai.djl.spring.configuration.DjlAutoConfiguration
-
@Configuration @ConditionalOnMissingBean(ai.djl.repository.zoo.ZooModel.class) @EnableConfigurationProperties(DjlConfigurationProperties.class) public class DjlAutoConfiguration extends Object
-
-
Constructor Summary
Constructors Constructor Description DjlAutoConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ai.djl.repository.zoo.ZooModel<?,?>
model()
Supplier<ai.djl.inference.Predictor<?,?>>
predictorProvider(ai.djl.repository.zoo.ZooModel<?,?> model)
Expected to be used with try-with-resources.
-
-
-
Method Detail
-
model
@Bean public ai.djl.repository.zoo.ZooModel<?,?> model() throws ai.djl.MalformedModelException, ai.djl.repository.zoo.ModelNotFoundException, IOException
- Throws:
ai.djl.MalformedModelException
ai.djl.repository.zoo.ModelNotFoundException
IOException
-
predictorProvider
@Bean public Supplier<ai.djl.inference.Predictor<?,?>> predictorProvider(ai.djl.repository.zoo.ZooModel<?,?> model)
Expected to be used with try-with-resources. The provided predictor isAutoCloseable
.- Parameters:
model
- injected configured model- Returns:
- provider of the predictor object
-
-