Skip to content

Commit

Permalink
upgrade djl version to 0.28.0 to fix CVE
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavana Ramaram <rbhavna@amazon.com>
  • Loading branch information
rbhavna committed Jun 19, 2024
1 parent fbb5ca7 commit 1e6a8ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ml-algorithms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ dependencies {
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.7.0'
implementation group: 'com.google.guava', name: 'guava', version: '32.1.2-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
implementation platform("ai.djl:bom:0.21.0")
implementation group: 'ai.djl.pytorch', name: 'pytorch-model-zoo', version: '0.21.0'
implementation platform("ai.djl:bom:0.28.0")
implementation group: 'ai.djl.pytorch', name: 'pytorch-model-zoo'
implementation group: 'ai.djl', name: 'api'
implementation group: 'ai.djl.huggingface', name: 'tokenizers'
implementation("ai.djl.onnxruntime:onnxruntime-engine:0.21.0") {
implementation("ai.djl.onnxruntime:onnxruntime-engine") {
exclude group: "com.microsoft.onnxruntime", module: "onnxruntime"
}
def os = DefaultNativePlatform.currentOperatingSystem
//arm/macos doesn't support GPU
if (os.macOsX || System.getProperty("os.arch") == "aarch64") {
dependencies {
implementation "com.microsoft.onnxruntime:onnxruntime:1.14.0"
implementation "com.microsoft.onnxruntime:onnxruntime:1.17.1"
}
} else {
dependencies {
implementation "com.microsoft.onnxruntime:onnxruntime_gpu:1.14.0"
implementation "com.microsoft.onnxruntime:onnxruntime_gpu:1.17.1"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ protected void loadModel(
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
System.setProperty("PYTORCH_PRECXX11", "true");
System.setProperty("PYTORCH_VERSION", "1.13.1");
System.setProperty("DJL_CACHE_DIR", mlEngine.getMlCachePath().toAbsolutePath().toString());
// DJL will read "/usr/java/packages/lib" if don't set "java.library.path". That will throw
// access denied exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private void loadModel(File modelZipFile, String modelId, String modelName, Stri
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
System.setProperty("PYTORCH_PRECXX11", "true");
System.setProperty("PYTORCH_VERSION", "1.13.1");
System.setProperty("DJL_CACHE_DIR", mlEngine.getMlCachePath().toAbsolutePath().toString());
// DJL will read "/usr/java/packages/lib" if don't set "java.library.path". That will throw
// access denied exception
Expand Down

0 comments on commit 1e6a8ae

Please sign in to comment.