From 04d6561e768b21d26877ad50863a3c7b051ee2a3 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Mon, 17 Jun 2024 19:46:58 -0700 Subject: [PATCH] [pytorch] Fixes uploadS3 gradle task --- .../test/java/ai/djl/pytorch/integration/ALibUtilsTest.java | 2 +- engines/pytorch/pytorch-native/build.gradle.kts | 5 ++--- engines/tensorflow/tensorflow-native/build.gradle.kts | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/ALibUtilsTest.java b/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/ALibUtilsTest.java index 89f3ab19d99..e176f07f7a3 100644 --- a/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/ALibUtilsTest.java +++ b/engines/pytorch/pytorch-engine/src/test/java/ai/djl/pytorch/integration/ALibUtilsTest.java @@ -27,7 +27,7 @@ public void setup() { TestRequirements.notMacX86(); System.setProperty("ai.djl.pytorch.native_helper", ALibUtilsTest.class.getName()); - System.setProperty("STDCXX_LIBRARY_PATH", "/usr/lib/non-exists"); + System.setProperty("LIBSTDCXX_LIBRARY_PATH", "/usr/lib/non-exists"); } @AfterClass diff --git a/engines/pytorch/pytorch-native/build.gradle.kts b/engines/pytorch/pytorch-native/build.gradle.kts index dc0c70ff972..16ff119f873 100644 --- a/engines/pytorch/pytorch-native/build.gradle.kts +++ b/engines/pytorch/pytorch-native/build.gradle.kts @@ -254,8 +254,8 @@ tasks { ) for (item in uploadDirs) fileTree(item).files.map { it.name }.forEach { - val out = item.relativeTo(File("${BINARY_ROOT}/")).absolutePath - appendLine(out + URLEncoder.encode(it, "UTF-8")) + val out = item.toRelativeString(File("${BINARY_ROOT}/")) + appendLine(out + "/" + URLEncoder.encode(it, "UTF-8")) } } exec { @@ -263,7 +263,6 @@ tasks { } } } - } java { diff --git a/engines/tensorflow/tensorflow-native/build.gradle.kts b/engines/tensorflow/tensorflow-native/build.gradle.kts index 0d25d4f27dc..0a735ecd5bd 100644 --- a/engines/tensorflow/tensorflow-native/build.gradle.kts +++ b/engines/tensorflow/tensorflow-native/build.gradle.kts @@ -72,8 +72,8 @@ tasks { ) for (item in uploadDirs) fileTree(item).files.map { it.name }.forEach { - val out = item.relativeTo(buildDirectory / "native/").absolutePath - appendLine(out + it) + val out = item.toRelativeString(buildDirectory / "native/") + appendLine("$out/$it") } } delete(