Merge pull request #10 from tuna2134/dynamic

dynamic loadingをサポート
This commit is contained in:
コマリン親衛隊
2024-09-11 12:24:32 +09:00
committed by GitHub
4 changed files with 20 additions and 2 deletions

11
Cargo.lock generated
View File

@@ -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",

View File

@@ -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'

View File

@@ -13,4 +13,5 @@ tokio = { version = "1.40.0", features = ["full"] }
[features]
cuda = ["sbv2_core/cuda"]
cuda_tf32 = ["sbv2_core/cuda_tf32"]
cuda_tf32 = ["sbv2_core/cuda_tf32"]
dynamic = ["sbv2_core/dynamic"]

View File

@@ -19,4 +19,5 @@ tokenizers = "0.20.0"
[features]
cuda = ["ort/cuda"]
cuda_tf32 = []
cuda_tf32 = []
dynamic = ["ort/load-dynamic"]