Package ai.djl.repository.zoo
Interface ModelLoader
-
- All Known Implementing Classes:
BaseModelLoader
public interface ModelLoaderA ModelLoader loads a particularZooModelfrom a Repository for a model zoo.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationgetApplication()Returns the application of theModelLoader.java.lang.StringgetArtifactId()Returns the artifact ID of theModelLoader.java.util.List<Artifact>listModels()Returns a list of the available artifacts that can be loaded.<I,O>
ZooModel<I,O>loadModel(Criteria<I,O> criteria)Loads the model with the given criteria.
-
-
-
Method Detail
-
getArtifactId
java.lang.String getArtifactId()
Returns the artifact ID of theModelLoader.- Returns:
- the artifact ID of the
ModelLoader
-
getApplication
Application getApplication()
Returns the application of theModelLoader.- Returns:
- the application of the
ModelLoader
-
loadModel
<I,O> ZooModel<I,O> loadModel(Criteria<I,O> criteria) throws java.io.IOException, ModelNotFoundException, MalformedModelException
Loads the model with the given criteria.- Type Parameters:
I- the input data typeO- the output data type- Parameters:
criteria- the criteria to match against the loaded model- Returns:
- the loaded model
- Throws:
java.io.IOException- for various exceptions loading data from the repositoryModelNotFoundException- if no model with the specified criteria is foundMalformedModelException- if the model data is malformed
-
listModels
java.util.List<Artifact> listModels() throws java.io.IOException, ModelNotFoundException
Returns a list of the available artifacts that can be loaded.- Returns:
- a list of the available artifacts that can be loaded
- Throws:
java.io.IOException- for errors reading the artifact listModelNotFoundException- if models with the mrl defined within this loader are found
-
-