spring-boot - 如何在 springboot kotlin 项目中设置 AI
问题描述
我想在我的项目中使用深度学习 java lib。但我无法在基于 Spring Boot kotlin Gradle 的项目中设置 AI DJL。我使用 Buildgradle.kts ,但我不知道如何在 buildgradle.kts 中添加 ai.djl。
解决方案
DJL 提供 springboot 启动包,你可以在你的 build.gradle.kts 中添加以下部分:
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("ai.djl.spring:djl-spring-boot-starter-pytorch-auto:0.11")
implementation("org.springframework.boot:spring-boot-starter-actuator")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
// See: https://github.com/awslabs/djl/blob/master/mxnet/mxnet-engine/README.md for MXNet library selection
}
您可以从 github 找到 DJL springboot starter 演示项目:https ://github.com/deepjavalibrary/djl-spring-boot-starter-demo
推荐阅读
- ruby - `gem update` 仅适用于新版本
- php - 获取快速加载后修改的网页?
- azure - 本地主机上的 Azure VHD 解密
- php - 具有多个选项卡的多个查询的分页解决方案 Wordpress
- java - csc -version 正在终端中运行,但不是从我的 java 程序 MAC 中运行
- javascript - 如何在“src”javascript脚本中使用谷歌地图API
- python-3.x - 如何在没有 PyCharm IDE 的情况下运行代码
- python - 对另一个类的对象执行计算
- python - 将值插入二叉树但不产生任何值
- dart - 比较列表中的字符串