Commit e8c80b6
authored
This PR addresses the concern raised in #2030 (and before in
microsoft/onnxruntime#27656) regarding the missing dependency between
`onnxruntime-genai` and the core `onnxruntime` Java artifact.
Currently, `GenAI.java` assumes that the native ONNX Runtime libraries
are available on the classpath and attempts to load them directly.
However, without an explicit Maven dependency, this is not guaranteed
and can lead to runtime issues.
Additionally, this setup duplicates native library loading logic that
already exists in `OrtRuntime.java`, creating unnecessary maintenance
overhead and inconsistencies (e.g., missing extraction of
`onnxruntime_providers_shared`).
Other ecosystem packages already declare this dependency:
* The NuGet package includes a [dependency on ONNX
Runtime](https://www.nuget.org/packages/Microsoft.ML.OnnxRuntimeGenAI)
* The PyPI package does as well (see the `METADATA` file in a
[onnxruntime-genai wheel](https://pypi.org/project/onnxruntime-genai))
Aligning the Java package with this behavior ensures consistency across
platforms and provides a more predictable and reliable setup for users.
Adding this dependency makes the expectation explicit and lays the
groundwork for potentially reusing the existing native loading logic in
the future.
1 parent 80dd558 commit e8c80b6
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| |||
0 commit comments