Skip to content

Commit

Permalink
avoid laoding previous versions
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 15, 2023
1 parent bcbfb34 commit 2ae2e15
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public class PytorchJavaCPPInterface implements DeepLearningEngineInterface
private static final String DTYPE_KEY = "dtype";
private static final String IS_INPUT_KEY = "isInput";
private static final String MEM_NAME_KEY = "memoryName";
/**
* Name without vesion of the JAR created for this library
*/
private static final String JAR_FILE_NAME = "dl-modelrunner-pytorch-javacpp";

/**
* Constructor for the interface. It is going to be called from the
Expand Down Expand Up @@ -463,6 +467,8 @@ private List<String> getProcessCommandsWithoutArgs() throws IOException, URISynt
String codeSource = protectionDomain.getCodeSource().getLocation().getPath();
String f_name = URLDecoder.decode(codeSource, StandardCharsets.UTF_8.toString());
for (File ff : new File(f_name).getParentFile().listFiles()) {
if (ff.getName().startsWith(JAR_FILE_NAME) && !ff.getAbsolutePath().equals(f_name))
continue;
classpath += ff.getAbsolutePath() + File.pathSeparator;
}
String className = PytorchJavaCPPInterface.class.getName();
Expand Down

0 comments on commit 2ae2e15

Please sign in to comment.