-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish onnxruntime-extensions Builds for Java to Maven Central #597
Comments
+1 |
@HichemMaiza I am facing a similar issue. I looked up your github link but does not seem understand clearly the steps to include onnxruntime-extensions in my Kotlin+Java project. For example, I do not have pom.xml in my project I added this in my build.gradle.kts:
I see this error:
Can you please further explain the steps? |
I installed mvn3.9.5 from here , ran Still not sure how to import this. |
I added in my
Not able yet to import it in my Kotlin+Java code to be able to use the library. Any help? |
The name used in the gradle dependency is not the package name. You should still use |
I did the import @Craigacp.. but that's the error I got:
Any clue? |
@HossamAmer12 as @Craigacp already mentioned, you need to do import ai.onnxruntime.extensions.OrtxPackage;
// ...
OrtSession.SessionOptions sessionOptions = new OrtSession.SessionOptions() ;
sessionOptions.registerCustomOpLibrary(OrtxPackage.getLibraryPath()); |
@HichemMaiza I did this import but I still get the error. Also did the steps above |
@HossamAmer12 Thank you for your feedback, may I ask what OS are you using ? |
@HichemMaiza I am using WSL 2.0 on Windows OS. |
check here: https://github.com/microsoft/onnxruntime-extensions/tree/main/tutorials/demo4j, you may need to manully copy the jar file to app libs folder. Publish jar file to Maven Central could be done in the late releases if the resource allows us to do so. |
@wenbingl I looked up the link and found this comment: I could not find or locate the directory above. Any clue? or any chance you can share a jar file for 0.8 ORT-extensions? |
The package was built from source, https://github.com/microsoft/onnxruntime-extensions/blob/main/java/README.md I just verified the build is still OK, and shared the JAR file for experiment here: https://1drv.ms/u/s!AgQZTAPsze9AiM8lA6AfPF6bL7803Q?e=8Yt9UZ |
Thanks @wenbingl |
Is your grade build set to look for dependencies in the libs folder? That's not the default behaviour for regular non-android gradle builds. |
@Craigacp How can I do that? |
My I followed this link: The file with As soon as I add this statement, it does not build:
error:
|
That sounds like a Kotlin syntax problem rather than any issue with the library. Is the line registering the ops library inside a function or init block? |
But I am not a Kotlin user, only see the difference between yours and theirs. |
It would be nice to get Java builds going for this, the stable diffusion sample code I released earlier this week tells users to compile this repo from source and copy the binary in which isn't particularly user friendly - https://github.com/oracle-samples/sd4j. |
@Craigacp Thank you for your contribution; I completely agree !! |
Just following up on this issue, has there been any updates? |
it's in the plan, and am looking for the resource and it could be done in the next month. |
@wenbingl Great news ! |
@wenbingl has there been any updates on this? |
@sayanshaw24 is working on a pipeline to compile JNI for multiple platforms into one Jar file now. |
@wenbingl @sayanshaw24 any pointer how to use the new change? |
It will be available in Maven repo on the next ort-extensions 0.11 release, which will be early next month |
Just by curiosity, any visibility on when 0.11 will then be released? Thank you |
The release team is working on that, and the packages will be public in a couple of days. |
Thanks @wenbingl. Playing at building the JAR myself meanwhile, I realize that the current build conflicts with the Hence, the compilation fails if I have a modular project depending on both |
I made a PR to fix the module name #730. |
The release on Maven Central of ORT extensions v0.11.0 contains x64 binaries for Windows, macOS and Linux, but ORT v1.18.0 contains binaries for arm64 macOS and Linux as well as the x64 binaries. I think support for building the arm64 binaries has been added to the project (at least on the build system side, not sure about the CI), is it possible to get them folded into the next release of ORT extensions on Maven Central? |
I've mentioned this on #764, but com.microsoft.onnxruntime:onnxruntime-extensions:0.11.0 is broken. The embedded onnxruntime_extensions4j_jni.dll file is missing the RegisterCustomOps function, which means it can't be used at all on Windows. The RegisterCustomOps function is there for Linux in libonnxruntime_extensions4j_jni.so, but for some reason this file is a whooping 176M in size! The equivalent .so in the 0.10.0 Nuget package is 5.1MB in size. Can we please fix this? This is a blocker for Windows projects. |
The 0.12.4 release on Maven Central is still missing macOS arm64 (and Linux arm64, though that's less relevant for my usecase). Is it possible to get that binary added to the jar in the next release? |
Hello Guys, Can we publish onnxruntime-extensions to maven central ? This addition would significantly benefit the Java community, allowing users to easily integrate it into their projects through Maven or Gradle dependencies. Currently, adding onnxruntime to a Java project is straightforward with the following Maven dependency:
To further enhance the experience, we may add the following dependency
I have personally built version 0.9.0 and tested it with OnnxRuntime version 1.16.0 across multiple models in the Microsoft/Olive repository. You can find my builds on GitHub https://github.com/HichemMaiza/onnxruntime-extensions-java.
This addition to Maven Central would greatly simplify the integration of onnxruntime-extensions into Java projects and open up new possibilities for the Java community.
Thank you for considering this proposal. Please let me know if you need any further information.
The text was updated successfully, but these errors were encountered: