Skip to content
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

Initial Java bindings. #461

Merged
merged 14 commits into from
May 30, 2024
Merged

Initial Java bindings. #461

merged 14 commits into from
May 30, 2024

Conversation

skottmckay
Copy link
Contributor

Java bindings for GenAI C API, as well as a SimpleGenAI class for simplified basic usage (text in, text out, single request with optional callback for token-by-token output).

Builds and the unit tests pass on Windows.

The Android setup has been copied from ORT but is currently untested so can be ignored for now.

The Android setup has been copied from ORT but is currently untested so can be ignored for now.
src/java/src/main/java/ai/onnxruntime_genai/GenAI.java Outdated Show resolved Hide resolved
src/java/src/main/java/ai/onnxruntime_genai/GenAI.java Outdated Show resolved Hide resolved
src/java/gradlew Show resolved Hide resolved
src/java/src/main/java/ai/onnxruntime_genai/Generator.java Outdated Show resolved Hide resolved
src/java/src/main/native/tokenizer_stream.cpp Outdated Show resolved Hide resolved
src/java/src/main/native/utils.cpp Outdated Show resolved Hide resolved
src/java/src/main/native/utils.cpp Outdated Show resolved Hide resolved
src/java/Debugging.md Outdated Show resolved Hide resolved
src/java/Debugging.md Outdated Show resolved Hide resolved
Try and improve debugging setup. Can at least run junit from the command line, but the whole java.library.path setup is still and issue.
src/java/Debugging.md Outdated Show resolved Hide resolved
src/java/CMakeLists.txt Outdated Show resolved Hide resolved
src/java/CMakeLists.txt Outdated Show resolved Hide resolved
src/java/README.md Show resolved Hide resolved
src/java/README.md Outdated Show resolved Hide resolved
src/java/src/main/native/tokenizer.cpp Outdated Show resolved Hide resolved
src/java/src/main/native/generator_params.cpp Outdated Show resolved Hide resolved
Copy link

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I still need to make build.sh executable to get the build to run on a clean checkout, and the test generation is still locked off to Windows, but otherwise everything passes cleanly on Linux x64 when I checked it. MacOS will be fine when the environment detection is fixed.

cmake/global_variables.cmake Outdated Show resolved Hide resolved
@skottmckay skottmckay marked this pull request as ready for review May 20, 2024 23:30
@skottmckay skottmckay changed the title [DRAFT] Initial Java bindings. Initial Java bindings. May 20, 2024
src/java/build.gradle Outdated Show resolved Hide resolved
src/java/Debugging.md Show resolved Hide resolved
src/java/src/test/android/.gitignore Show resolved Hide resolved
@skottmckay skottmckay merged commit a045763 into main May 30, 2024
12 checks passed
@skottmckay skottmckay deleted the skottmckay/InitialJavaBindings branch May 30, 2024 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants