I
- the input data typeO
- the output data typepublic interface ModelLoader<I,O>
ZooModel
from a Repository for a model zoo.Modifier and Type | Method and Description |
---|---|
Application |
getApplication()
Returns the application of the
ModelLoader . |
java.lang.String |
getArtifactId()
Returns the artifact ID of the
ModelLoader . |
java.util.List<Artifact> |
listModels()
Returns a list of the available artifacts that can be loaded.
|
default ZooModel<I,O> |
loadModel()
Loads the model.
|
<S,T> ZooModel<S,T> |
loadModel(Criteria<S,T> criteria)
Loads the model with the given criteria.
|
default ZooModel<I,O> |
loadModel(java.util.Map<java.lang.String,java.lang.String> filters)
Loads the model with the given search filters.
|
ZooModel<I,O> |
loadModel(java.util.Map<java.lang.String,java.lang.String> filters,
Device device,
ai.djl.util.Progress progress)
Loads the model with the given search filters.
|
default ZooModel<I,O> |
loadModel(java.util.Map<java.lang.String,java.lang.String> filters,
ai.djl.util.Progress progress)
Loads the model with the given search filters.
|
default ZooModel<I,O> |
loadModel(ai.djl.util.Progress progress)
Loads the model.
|
java.lang.String getArtifactId()
ModelLoader
.ModelLoader
Application getApplication()
ModelLoader
.ModelLoader
<S,T> ZooModel<S,T> loadModel(Criteria<S,T> criteria) throws java.io.IOException, ModelNotFoundException, MalformedModelException
S
- the input data typeT
- the output data typecriteria
- the criteria to match against the loaded modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformeddefault ZooModel<I,O> loadModel() throws MalformedModelException, ModelNotFoundException, java.io.IOException
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 malformeddefault ZooModel<I,O> loadModel(ai.djl.util.Progress progress) throws MalformedModelException, ModelNotFoundException, java.io.IOException
progress
- the progress tracker to update while loading the modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformeddefault ZooModel<I,O> loadModel(java.util.Map<java.lang.String,java.lang.String> filters) throws MalformedModelException, ModelNotFoundException, java.io.IOException
filters
- the search filters to match against the loaded modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformeddefault ZooModel<I,O> loadModel(java.util.Map<java.lang.String,java.lang.String> filters, ai.djl.util.Progress progress) throws MalformedModelException, ModelNotFoundException, java.io.IOException
filters
- the search filters to match against the loaded modelprogress
- the progress tracker to update while loading the modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformedZooModel<I,O> loadModel(java.util.Map<java.lang.String,java.lang.String> filters, Device device, ai.djl.util.Progress progress) throws java.io.IOException, ModelNotFoundException, MalformedModelException
filters
- the search filters to match against the loaded modeldevice
- the device the loaded model should useprogress
- the progress tracker to update while loading the modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformedjava.util.List<Artifact> listModels() throws java.io.IOException, ModelNotFoundException
java.io.IOException
- for errors reading the artifact listModelNotFoundException
- if models with the mrl defined within this loader are found