public class LocalModelLoader extends java.lang.Object implements ModelLoader<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList>
ModelLoader loads a particular ZooModel from a local folder.| Constructor and Description |
|---|
LocalModelLoader(Repository repository)
Creates the model loader from the given repository.
|
| Modifier and Type | Method and Description |
|---|---|
ai.djl.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.
|
<S,T> ZooModel<S,T> |
loadModel(Criteria<S,T> criteria)
Loads the model with the given criteria.
|
ZooModel<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList> |
loadModel(java.util.Map<java.lang.String,java.lang.String> filters,
ai.djl.Device device,
ai.djl.util.Progress progress)
Loads the model with the given search filters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadModel, loadModel, loadModel, loadModelpublic LocalModelLoader(Repository repository)
repository - the repository to load the model frompublic java.lang.String getArtifactId()
ModelLoader.getArtifactId in interface ModelLoader<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList>ModelLoaderpublic ai.djl.Application getApplication()
ModelLoader.getApplication in interface ModelLoader<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList>ModelLoaderpublic <S,T> ZooModel<S,T> loadModel(Criteria<S,T> criteria) throws java.io.IOException, ModelNotFoundException, ai.djl.MalformedModelException
loadModel in interface ModelLoader<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList>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 foundai.djl.MalformedModelException - if the model data is malformedpublic ZooModel<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList> loadModel(java.util.Map<java.lang.String,java.lang.String> filters, ai.djl.Device device, ai.djl.util.Progress progress) throws java.io.IOException, ModelNotFoundException, ai.djl.MalformedModelException
loadModel in interface ModelLoader<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList>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 foundai.djl.MalformedModelException - if the model data is malformedpublic java.util.List<Artifact> listModels()
listModels in interface ModelLoader<ai.djl.ndarray.NDList,ai.djl.ndarray.NDList>