Comments (34)
@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
from onnxruntime-extensions.
Just following up on this issue, has there been any updates? @wenbingl wenbingl
it's in the plan, and am looking for the resource and it could be done in the next month.
from onnxruntime-extensions.
@sayanshaw24 is working on a pipeline to compile JNI for multiple platforms into one Jar file now.
from onnxruntime-extensions.
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?
from onnxruntime-extensions.
The name used in the gradle dependency is not the package name. You should still use import ai.onnxruntime.extensions.OrtxPackage;
.
from onnxruntime-extensions.
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.
from onnxruntime-extensions.
Just following up on this issue, has there been any updates?
@wenbingl wenbingl
from onnxruntime-extensions.
+1
from onnxruntime-extensions.
@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:
implementation("com.hichemmaiza.onnx:onnxruntime-extensions-java:0.10.0-SNAPSHOT")
I see this error:
- What went wrong:
Execution failed for task ':app:compileKotlin'.
Error while evaluating property 'filteredArgumentsMap' of task ':app:compileKotlin'.
Could not resolve all files for configuration ':app:compileClasspath'.
> Could not find com.hichemmaiza.onnx:onnxruntime-extensions-java:0.10.0-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/hichemmaiza/onnx/onnxruntime-extensions-java/0.10.0-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/com/hichemmaiza/onnx/onnxruntime-extensions-java/0.10.0-SNAPSHOT/onnxruntime-extensions-java-0.10.0-SNAPSHOT.pom
Required by:
project :app
Can you please further explain the steps?
from onnxruntime-extensions.
I installed mvn3.9.5 from here , ran mvn clean install
from your github repo
and saw the following:
Still not sure how to import this.
from onnxruntime-extensions.
I added in my build.gradle.kts
the following:
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
// maven local
mavenLocal()
}
dependencies {
implementation("com.hichemmaiza.onnx:onnxruntime-extensions-java:0.10.0-SNAPSHOT")
}
Not able yet to import it in my Kotlin+Java code to be able to use the library.
I tried this import com.hichemmaiza.onnx.*;
. Tells me unresolved reference to hichemmaiza
Any help?
from onnxruntime-extensions.
I did the import @Craigacp.. but that's the error I got:
/home/hossamamer/workspace/Emoji_workspace/Android-emoji/app/src/main/kotlin/EmojiPredictor.kt: (11, 34): Unresolved reference: OrtxPackage
Any clue?
from onnxruntime-extensions.
@HossamAmer12 as @Craigacp already mentioned, you need to do
import ai.onnxruntime.extensions.OrtxPackage;
// ...
OrtSession.SessionOptions sessionOptions = new OrtSession.SessionOptions() ;
sessionOptions.registerCustomOpLibrary(OrtxPackage.getLibraryPath());
from onnxruntime-extensions.
@HichemMaiza I did this import but I still get the error. Also did the steps above
from onnxruntime-extensions.
@HossamAmer12 Thank you for your feedback, may I ask what OS are you using ?
from onnxruntime-extensions.
@HichemMaiza I am using WSL 2.0 on Windows OS.
from onnxruntime-extensions.
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.
from onnxruntime-extensions.
@wenbingl I looked up the link and found this comment:
copy JAR package from $REPO/out/$OS/RelWithDebInfo/java/build/libs/onnxruntime-extensions-${VERSION}.jar into app/libs folder.
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?
from onnxruntime-extensions.
@wenbingl I looked up the link and found this comment:
copy JAR package from $REPO/out/$OS/RelWithDebInfo/java/build/libs/onnxruntime-extensions-${VERSION}.jar into app/libs folder.
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
from onnxruntime-extensions.
Thanks @wenbingl
I created a libs folder in my project and pasted your JAR file into this folder. But I still get this import error. What do I need to do to ensure that JAR file is properly imported in my project?
from onnxruntime-extensions.
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.
from onnxruntime-extensions.
@Craigacp How can I do that?
from onnxruntime-extensions.
https://discuss.gradle.org/t/how-to-include-local-jar-file-in-gradle/37744/2
from onnxruntime-extensions.
My build.gradle.kts
should follow the kotlin way to include.
I followed this link:
https://stackoverflow.com/questions/54166069/how-do-you-add-local-jar-file-dependency-to-build-gradle-kt-file
The file with
import ai.onnxruntime.extensions.OrtxPackage
was OK
As soon as I add this statement, it does not build:
val sessionOptions = OrtSession.SessionOptions()
/* Register the custom ops from onnxruntime-extensions */
sessionOptions.registerCustomOpLibrary(OrtxPackage.getLibraryPath());
error:
(39, 5): Expecting member declaration
from onnxruntime-extensions.
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?
from onnxruntime-extensions.
OrtxPackage
But I am not a Kotlin user, only see the difference between yours and theirs.
from onnxruntime-extensions.
@Craigacp Thank you for your contribution; I completely agree !!
I used ONNX to infer the Whisper model, and I didn't want to upload it before finding a solution to onnxruntime-extensions. Asking Java developers to compile the repo means we've already lost 90% of them.
from onnxruntime-extensions.
@wenbingl Great news !
from onnxruntime-extensions.
@wenbingl has there been any updates on this?
from onnxruntime-extensions.
@wenbingl @sayanshaw24 any pointer how to use the new change?
from onnxruntime-extensions.
Just by curiosity, any visibility on when 0.11 will then be released? Thank you
from onnxruntime-extensions.
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.
from onnxruntime-extensions.
Thanks @wenbingl. Playing at building the JAR myself meanwhile, I realize that the current build conflicts with the onnxruntime
release, as both are exported as Java module under the same name: com.microsoft.onnxruntime
, as we can see here: https://github.com/microsoft/onnxruntime-extensions/blame/8d8670f7e87e9bb456b4b017879e8e4bb5aedfe3/java/build.gradle#L116
Hence, the compilation fails if I have a modular project depending on both com.microsoft.onnxruntime:onnxruntime
and com.microsoft.onnxruntime:onnxruntime-extensions
. Will that be fixed for the release?
from onnxruntime-extensions.
I made a PR to fix the module name #730.
from onnxruntime-extensions.
Related Issues (20)
- Whisper Preprocessing Pipeline is incompatible with whisper-large-v3
- [WordTokenizer] SIGSEGV when testing example code for WordTokenizer HOT 3
- Implement HF WordLevel Tokenizer HOT 1
- How to drop a channel using onnxruntime-extensions? HOT 1
- Add compatibility in java ext for arm64 HOT 1
- ORT Extensions package is out of date on Maven
- onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op HOT 2
- How to export preprocessing as its own model? HOT 1
- BUG OR HACK? 0.10.1 in pypi without github tag HOT 1
- Adding onnxruntime-extensions to conda-forge HOT 1
- Can't load OnnxRuntimeExtension on ubuntu with c#
- Post-processing error adding IoMapEntry for CenterCrop exporting YoloV8 model HOT 2
- ValueError: Unsupported processor/tokenizer: Qwen2Tokenizer HOT 1
- Update of onnuxruntime-extensions in the PyPi repository HOT 2
- "Export" Custom Ops Library After Registering Ops? HOT 2
- Onnxruntime JAR for darwin aarch64 HOT 2
- poor c# documentation, need help on implementing some py examples HOT 1
- Performance issue on basic string operations HOT 3
- DecodeImage: Failed to decode image when using direct ByteBuffer (Android) HOT 2
- Is it possible to create a custom Step for PrePostProcessor pipeline? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxruntime-extensions.