首页 > 解决方案 > 如何在 springboot kotlin 项目中设置 AI

问题描述

我想在我的项目中使用深度学习 java lib。但我无法在基于 Spring Boot kotlin Gradle 的项目中设置 AI DJL。我使用 Buildgradle.kts ,但我不知道如何在 buildgradle.kts 中添加 ai.djl。

标签: spring-bootkotlindjl

解决方案


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


推荐阅读