Package org.apache.ignite.example.ml
Class ModelUtils
java.lang.Object
org.apache.ignite.example.ml.ModelUtils
Base class for ML examples with functions to
1. Download the model from DJL via URLs
2. Download the model files from any URLs
3. Deploy the Model
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ModelUtils
public ModelUtils()
-
-
Method Details
-
downloadDjlModel
public static <I,O> void downloadDjlModel(String modelUrl, Class<I> inputClass, Class<O> outputClass, String targetDirectory, String translatorFactoryClassName) throws IOException, ai.djl.repository.zoo.ModelNotFoundException, ai.djl.MalformedModelException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, ClassNotFoundException Downloads the model from DJL- Type Parameters:
I- Type of InputO- Type of Output- Parameters:
modelUrl- DJL URL of the modelinputClass- Input to the modeloutputClass- Output from modeltargetDirectory- Path at which the model should be downloaded- Throws:
IOException- If target directory is invalid or copy failsai.djl.repository.zoo.ModelNotFoundException- If model is not found for the given criteriaai.djl.MalformedModelException- If Model files are incompleteNoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessExceptionClassNotFoundException
-