diff --git a/Cargo.lock b/Cargo.lock index 50d0893..596d85a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -888,6 +888,16 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "libredox" version = "0.1.3" @@ -1267,6 +1277,7 @@ version = "2.0.0-rc.6" source = "git+https://github.com/pykeio/ort.git#ee5cc2046c346b8e6f71ce543c1f6d31702337de" dependencies = [ "half", + "libloading", "ndarray", "ort-sys", "tracing", diff --git a/README.md b/README.md index abed42b..cc1e02b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,11 @@ cargo run -p sbv2_api -r cargo run -p sbv2_api -r -F cuda,cuda_tf32 ``` +### Dynamicのサポート +```bash +ORT_DYLIB_PATH=./libonnxruntime.dll cargo run -p sbv2_api -r -F dynamic +``` + ### テストコマンド ```bash curl -XPOST -H "Content-type: application/json" -d '{"text": "こんにちは"}' 'http://localhost:3000/synthesize' diff --git a/sbv2_api/Cargo.toml b/sbv2_api/Cargo.toml index 6a0abe9..f14fd27 100644 --- a/sbv2_api/Cargo.toml +++ b/sbv2_api/Cargo.toml @@ -13,4 +13,5 @@ tokio = { version = "1.40.0", features = ["full"] } [features] cuda = ["sbv2_core/cuda"] -cuda_tf32 = ["sbv2_core/cuda_tf32"] \ No newline at end of file +cuda_tf32 = ["sbv2_core/cuda_tf32"] +dynamic = ["sbv2_core/dynamic"] \ No newline at end of file diff --git a/sbv2_core/Cargo.toml b/sbv2_core/Cargo.toml index 557cfdd..817748c 100644 --- a/sbv2_core/Cargo.toml +++ b/sbv2_core/Cargo.toml @@ -19,4 +19,5 @@ tokenizers = "0.20.0" [features] cuda = ["ort/cuda"] -cuda_tf32 = [] \ No newline at end of file +cuda_tf32 = [] +dynamic = ["ort/load-dynamic"] \ No newline at end of file