Skip to content

Commit

Permalink
[AI] Add more uses statements (#11788)
Browse files Browse the repository at this point in the history
* Add more uses statements

* Make use of BOM

* Add requires 'ai.djl.pytorch_model_zoo'

* Trying downgrade of djl

* Sort "requires" alphabetically

* Add org.freedesktop.dbus as requriement

* Sort "uses" alphabetically

* Add "provides"

* Update djl to 0.30.0

* Fix jackson requirements
  • Loading branch information
koppor authored Sep 19, 2024
1 parent a6912d4 commit c5e81a9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 30 deletions.
70 changes: 41 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ dependencies {
// YAML formatting
implementation 'org.yaml:snakeyaml:2.3'

// AI
// region AI
implementation 'dev.langchain4j:langchain4j:0.34.0'
// Even though we use jvm-openai for LLM connection, we still need this package for tokenization.
implementation('dev.langchain4j:langchain4j-open-ai:0.34.0') {
Expand All @@ -336,16 +336,19 @@ dependencies {
implementation('dev.langchain4j:langchain4j-mistral-ai:0.34.0')
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.34.0')
implementation('dev.langchain4j:langchain4j-hugging-face:0.34.0')
implementation 'ai.djl:api:0.30.0'
implementation 'ai.djl.pytorch:pytorch-model-zoo:0.30.0'
implementation 'ai.djl.huggingface:tokenizers:0.29.0'

implementation platform('ai.djl:bom:0.30.0')
implementation 'ai.djl:api'
implementation 'ai.djl.huggingface:tokenizers'
implementation 'ai.djl.pytorch:pytorch-model-zoo'
implementation 'io.github.stefanbratanov:jvm-openai:0.11.0'
// openai depends on okhttp, which needs kotlin - see https://github.com/square/okhttp/issues/5299 for details
implementation ('com.squareup.okhttp3:okhttp:4.12.0') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
// GemxFX also (transitively) depends on kotlin
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.20'
// endregion

implementation 'commons-io:commons-io:2.16.1'

Expand Down Expand Up @@ -735,51 +738,58 @@ jlink {

// TODO: Remove the following correction to the merged module
// The module descriptor automatically generated by the plugin for the merged module contained some invalid entries.
// This is based on ./gradlew suggestMergedModuleInfo, sort, strip ";"", comment non-used modules, and include the suggested directives here.
// However, we need to fine-tune this manually (non-alphabetic order)
// This is based on ./gradlew suggestMergedModuleInfo, sort, strip ";"", remove non-used modules, and include the suggested directives here.
mergedModule {
requires 'javafx.base'
requires 'javafx.controls'
requires 'javafx.fxml'
requires 'javafx.graphics'
requires 'javafx.media'
requires 'javafx.swing'

requires 'com.google.gson'
requires 'com.fasterxml.jackson.annotation'
requires 'com.fasterxml.jackson.databind'
requires 'com.fasterxml.jackson.core'
requires 'com.fasterxml.jackson.datatype.jdk8'
requires 'jakarta.xml.bind'
requires 'java.compiler'
requires 'java.datatransfer'
requires 'java.desktop'
requires 'java.logging'
requires 'java.management'
requires 'java.naming'
requires 'java.net.http'
requires 'java.rmi'
requires 'java.scripting'
requires 'java.security.jgss'
requires 'java.security.sasl'
requires 'java.sql'
requires 'java.sql.rowset'
requires 'java.transaction.xa'
requires 'java.rmi'
requires 'java.xml'
requires 'javafx.base'
requires 'javafx.controls'
requires 'javafx.fxml'
requires 'javafx.graphics'
requires 'javafx.media'
requires 'javafx.swing'
requires 'jdk.jsobject'
requires 'jdk.security.jgss'
requires 'jdk.unsupported'
requires 'jdk.unsupported.desktop'
requires 'jdk.security.jgss'
requires 'jdk.xml.dom'
requires 'com.google.gson'
requires 'org.jsoup'
requires 'org.slf4j'
requires 'jakarta.xml.bind'
requires 'org.apache.commons.lang3'
requires 'org.apache.commons.logging'
requires 'org.apache.commons.text'
requires 'org.apache.commons.logging';
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
requires 'org.freedesktop.dbus'
requires 'org.jsoup'
requires 'org.slf4j'
uses 'ai.djl.engine.EngineProvider'
uses 'ai.djl.repository.RepositoryFactory'
uses 'ai.djl.repository.zoo.ZooProvider'
uses 'dev.langchain4j.spi.prompt.PromptTemplateFactory'
uses 'kong.unirest.core.json.JsonEngine'
uses 'org.eclipse.jgit.lib.GpgSigner'
uses 'org.eclipse.jgit.transport.SshSessionFactory'
uses 'org.mariadb.jdbc.LocalInfileInterceptor'
uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin'
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
uses 'org.mariadb.jdbc.tls.TlsSocketPlugin'
uses 'org.mariadb.jdbc.LocalInfileInterceptor'
uses 'org.eclipse.jgit.transport.SshSessionFactory'
uses 'org.eclipse.jgit.lib.GpgSigner'
uses 'kong.unirest.core.json.JsonEngine';
uses 'ai.djl.repository.zoo.ZooProvider';

provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin'
provides 'java.sql.Driver' with 'org.postgresql.Driver'
provides 'org.mariadb.jdbc.authentication.AuthenticationPlugin' with 'org.mariadb.jdbc.internal.com.send.authentication.CachingSha2PasswordPlugin',
Expand All @@ -797,9 +807,11 @@ jlink {
'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider'
provides 'kong.unirest.core.json.JsonEngine' with 'kong.unirest.modules.gson.GsonEngine';
provides 'ai.djl.repository.zoo.ZooProvider' with 'ai.djl.engine.rust.zoo.RsZooProvider',
'ai.djl.huggingface.zoo.HfZooProvider',
'ai.djl.pytorch.zoo.PtZooProvider',
'ai.djl.repository.zoo.DefaultZooProvider';
'ai.djl.huggingface.zoo.HfZooProvider',
'ai.djl.pytorch.zoo.PtZooProvider',
'ai.djl.repository.zoo.DefaultZooProvider';
provides 'ai.djl.engine.EngineProvider' with 'ai.djl.engine.rust.RsEngineProvider',
'ai.djl.pytorch.engine.PtEngineProvider';
}

jpackage {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,18 @@

// region AI
requires ai.djl.api;
uses ai.djl.repository.zoo.ZooProvider;
requires ai.djl.pytorch_model_zoo;
requires ai.djl.tokenizers;
requires jvm.openai;
requires langchain4j;
requires langchain4j.core;
requires langchain4j.hugging.face;
requires langchain4j.mistral.ai;
requires langchain4j.open.ai;
uses ai.djl.engine.EngineProvider;
uses ai.djl.repository.RepositoryFactory;
uses ai.djl.repository.zoo.ZooProvider;
uses dev.langchain4j.spi.prompt.PromptTemplateFactory;
// endregion

// region: Lucene
Expand Down

0 comments on commit c5e81a9

Please sign in to comment.