public class DefaultModelLoader extends BaseModelLoader<NDList,NDList>
ModelLoader loads a particular ZooModel from a local folder.factories, modelZoo, mrl, repository, version| Constructor and Description |
|---|
DefaultModelLoader(Repository repository,
MRL mrl)
Creates the model loader from the given repository.
|
| Modifier and Type | Method and Description |
|---|---|
Application |
getApplication()
Returns the application of the
ModelLoader. |
ZooModel<NDList,NDList> |
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.
|
createModel, getArtifactId, listModels, loadModel, match, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitloadModel, loadModel, loadModel, loadModelpublic DefaultModelLoader(Repository repository, MRL mrl)
repository - the repository to load the model frommrl - the mrl of the model to loadpublic Application getApplication()
ModelLoader.ModelLoaderpublic ZooModel<NDList,NDList> 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 malformed