mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Another java fix
This commit is contained in:
parent
6076ef965b
commit
c419ff2487
1 changed files with 3 additions and 5 deletions
|
|
@ -191,6 +191,9 @@ final class OnnxRuntime {
|
|||
try (InputStream is = OnnxRuntime.class.getResourceAsStream(resourcePath)) {
|
||||
if (is == null) {
|
||||
// 3a) Not found in resources, load from library path
|
||||
if( !systemLoad ) {
|
||||
return; // Failure is expected if we try to pull in optional components we don't need to load
|
||||
}
|
||||
logger.log(
|
||||
Level.FINE, "Attempting to load native library '" + library + "' from library path");
|
||||
System.loadLibrary(library);
|
||||
|
|
@ -219,11 +222,6 @@ final class OnnxRuntime {
|
|||
logger.log(Level.FINE, "Extracted native library '" + library + "' from resource path");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (systemLoad) {
|
||||
// We only throw if we're loading the library, otherwise failure is okay
|
||||
throw e;
|
||||
}
|
||||
} finally {
|
||||
cleanUp(tempFile, !systemLoad);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue