Package ai.djl.repository.zoo
Interface ModelLoader
- All Known Implementing Classes:
- BaseModelLoader
public interface ModelLoader
A ModelLoader loads a particular 
ZooModel from a Repository for a model zoo.- 
Method SummaryModifier and TypeMethodDescription<I,O> void downloadModel(Criteria<I, O> criteria, ai.djl.util.Progress progress) Downloads the model artifacts to local directory.Returns the application of theModelLoader.Returns the artifact ID of theModelLoader.Returns the group ID of theModelLoader.<I,O> boolean isDownloaded(Criteria<I, O> criteria) Returnstrueif the model is downloaded in local directory.Returns a list of the available artifacts that can be loaded.<I,O> ZooModel<I, O> Loads the model with the given criteria.
- 
Method Details- 
getGroupIdString getGroupId()Returns the group ID of theModelLoader.- Returns:
- the group ID of the ModelLoader
 
- 
getArtifactIdString getArtifactId()Returns the artifact ID of theModelLoader.- Returns:
- the artifact ID of the ModelLoader
 
- 
getApplicationApplication getApplication()Returns the application of theModelLoader.- Returns:
- the application of the ModelLoader
 
- 
loadModel<I,O> ZooModel<I,O> loadModel(Criteria<I, O> criteria) throws IOException, ModelNotFoundException, MalformedModelExceptionLoads the model with the given criteria.- Type Parameters:
- I- the input data type
- O- the output data type
- Parameters:
- criteria- the criteria to match against the loaded model
- Returns:
- the loaded model
- Throws:
- IOException- for various exceptions loading data from the repository
- ModelNotFoundException- if no model with the specified criteria is found
- MalformedModelException- if the model data is malformed
 
- 
isDownloadedReturnstrueif the model is downloaded in local directory.- Type Parameters:
- I- the input data type
- O- the output data type
- Parameters:
- criteria- the criteria to match against the loaded model
- Returns:
- trueif the model is downloaded in local directory
- Throws:
- IOException- for various exceptions loading data from the repository
- ModelNotFoundException- if no model with the specified criteria is found
 
- 
downloadModel<I,O> void downloadModel(Criteria<I, O> criteria, ai.djl.util.Progress progress) throws IOException, ModelNotFoundExceptionDownloads the model artifacts to local directory.- Type Parameters:
- I- the input data type
- O- the output data type
- Parameters:
- criteria- the criteria to match against the loaded model
- progress- the progress tracker
- Throws:
- IOException- for various exceptions loading data from the repository
- ModelNotFoundException- if no model with the specified criteria is found
 
- 
listModelsReturns a list of the available artifacts that can be loaded.- Returns:
- a list of the available artifacts that can be loaded
- Throws:
- IOException- for errors reading the artifact list
- ModelNotFoundException- if models with the mrl defined within this loader are found
 
 
-