Compare commits

...

92 Commits

Author SHA1 Message Date
tuna2134
dc5fa88432 write license 2025-08-21 12:15:22 +09:00
tuna2134
a5f45cd2ef fix: license 2025-08-21 12:14:44 +09:00
tuna2134
84e9118d99 Merge pull request #237 from neodyland/dependabot/cargo/ureq-3.1.0
build(deps): bump ureq from 3.0.12 to 3.1.0
2025-08-18 22:58:45 +09:00
tuna2134
3050cc1e99 Merge pull request #238 from neodyland/dependabot/cargo/thiserror-2.0.15
build(deps): bump thiserror from 2.0.12 to 2.0.15
2025-08-18 22:58:16 +09:00
tuna2134
d5fcacd799 Merge pull request #239 from neodyland/dependabot/cargo/ort-d269461
build(deps): bump ort from `f4ab181` to `d269461`
2025-08-18 22:58:01 +09:00
tuna2134
25ca89e341 Merge pull request #240 from neodyland/dependabot/cargo/anyhow-1.0.99
build(deps): bump anyhow from 1.0.98 to 1.0.99
2025-08-18 22:57:45 +09:00
dependabot[bot]
0c2a397775 build(deps): bump anyhow from 1.0.98 to 1.0.99
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.98...1.0.99)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.99
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 11:08:26 +00:00
dependabot[bot]
470a0348fe build(deps): bump ort from f4ab181 to d269461
Bumps [ort](https://github.com/pykeio/ort) from `f4ab181` to `d269461`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](f4ab181702...d269461e21)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: d269461e2130b407589feff404025df25faeb3bb
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 11:06:31 +00:00
dependabot[bot]
9a99b88b00 build(deps): bump thiserror from 2.0.12 to 2.0.15
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.12 to 2.0.15.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.12...2.0.15)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-version: 2.0.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 10:49:47 +00:00
dependabot[bot]
29f39f0795 build(deps): bump ureq from 3.0.12 to 3.1.0
Bumps [ureq](https://github.com/algesten/ureq) from 3.0.12 to 3.1.0.
- [Changelog](https://github.com/algesten/ureq/blob/main/CHANGELOG.md)
- [Commits](https://github.com/algesten/ureq/compare/3.0.12...3.1.0)

---
updated-dependencies:
- dependency-name: ureq
  dependency-version: 3.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 10:49:32 +00:00
tuna2134
9f22694df0 Merge pull request #236 from neodyland/dependabot/cargo/ort-f4ab181 2025-08-12 07:48:08 +09:00
tuna2134
62ba2c802f Merge pull request #235 from kono-dada/fix/inplace-model-load 2025-08-11 23:46:42 +09:00
dependabot[bot]
4f5b936f6f build(deps): bump ort from 5f96a2d to f4ab181
Bumps [ort](https://github.com/pykeio/ort) from `5f96a2d` to `f4ab181`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](5f96a2d585...f4ab181702)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: f4ab181702495bff99a488322d3a8de0d7050349
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 12:22:23 +00:00
kono-dada
3c8efc716c Fix: Load model in-place and safely evict sessions without removing entries
- Avoid removing and re-inserting model entries during load
- Preserve metadata (bytes, style_vectors) when evicting
- Ensure eviction targets a different loaded model, not always the first
- Reduce unnecessary memory allocations and keep list order stable
2025-08-11 16:31:57 +08:00
tuna2134
e9ced32b70 fix: streamline tone value handling in JTalkProcess 2025-08-11 17:30:46 +09:00
tuna2134
e7a1575cbc Merge pull request #233 from kono-dada/feature/stereo-output
feat: add stereo synthesis option via SBV2_FORCE_STEREO env var
2025-08-11 17:13:19 +09:00
kono-dada
873bbb77b6 feat: add stereo synthesis option via SBV2_FORCE_STEREO env var
Previously, synthesis output was fixed to mono (channels=1).
Now, setting the environment variable SBV2_FORCE_STEREO=1 forces stereo (2-channel) output.

This allows generating stereo audio without changing the code, useful for users needing dual-channel output.
2025-08-11 11:38:32 +08:00
tuna2134
1725863fca Merge pull request #228 from neodyland/dependabot/cargo/serde_json-1.0.142
build(deps): bump serde_json from 1.0.141 to 1.0.142
2025-08-04 22:12:36 +09:00
tuna2134
55f05580e4 Merge pull request #229 from neodyland/dependabot/cargo/tokenizers-0.21.4
build(deps): bump tokenizers from 0.21.2 to 0.21.4
2025-08-04 22:12:24 +09:00
tuna2134
320664eae2 Merge pull request #231 from neodyland/dependabot/cargo/tokio-1.47.1
build(deps): bump tokio from 1.47.0 to 1.47.1
2025-08-04 22:12:07 +09:00
tuna2134
87903827fa Merge pull request #230 from neodyland/dependabot/cargo/ort-5f96a2d
build(deps): bump ort from `d28c835` to `5f96a2d`
2025-08-04 22:11:55 +09:00
dependabot[bot]
9b8e9dc39d build(deps): bump tokio from 1.47.0 to 1.47.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.47.0 to 1.47.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.47.0...tokio-1.47.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.47.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 11:10:28 +00:00
dependabot[bot]
bbc38081b6 build(deps): bump ort from d28c835 to 5f96a2d
Bumps [ort](https://github.com/pykeio/ort) from `d28c835` to `5f96a2d`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](d28c835c3c...5f96a2d585)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: 5f96a2d5857c3fe9f06282dbf4bdcddbca6c5fe6
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 10:24:07 +00:00
dependabot[bot]
0b822f704a build(deps): bump tokenizers from 0.21.2 to 0.21.4
Bumps [tokenizers](https://github.com/huggingface/tokenizers) from 0.21.2 to 0.21.4.
- [Release notes](https://github.com/huggingface/tokenizers/releases)
- [Changelog](https://github.com/huggingface/tokenizers/blob/main/RELEASE.md)
- [Commits](https://github.com/huggingface/tokenizers/compare/v0.21.2...v0.21.4)

---
updated-dependencies:
- dependency-name: tokenizers
  dependency-version: 0.21.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 10:18:59 +00:00
dependabot[bot]
132eb6386d build(deps): bump serde_json from 1.0.141 to 1.0.142
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.141 to 1.0.142.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.141...v1.0.142)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-version: 1.0.142
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 10:18:20 +00:00
tuna2134
ee56e9591d Merge pull request #227 from neodyland/dependabot/cargo/tokio-1.47.0
build(deps): bump tokio from 1.46.1 to 1.47.0
2025-07-28 21:02:19 +09:00
dependabot[bot]
3194e599b2 build(deps): bump tokio from 1.46.1 to 1.47.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.46.1 to 1.47.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.46.1...tokio-1.47.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.47.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 10:53:38 +00:00
tuna2134
00f4787f6e Merge pull request #225 from neodyland/dependabot/cargo/serde_json-1.0.141
build(deps): bump serde_json from 1.0.140 to 1.0.141
2025-07-22 14:28:18 +09:00
tuna2134
4b6c72aa51 Merge pull request #226 from neodyland/dependabot/cargo/ort-d28c835
build(deps): bump ort from `1e6f7ee` to `d28c835`
2025-07-22 14:28:09 +09:00
dependabot[bot]
7db6bb67a4 build(deps): bump ort from 1e6f7ee to d28c835
Bumps [ort](https://github.com/pykeio/ort) from `1e6f7ee` to `d28c835`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](1e6f7ee1c8...d28c835c3c)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: d28c835c3cc98bcbefc208dc26c8618ccbadec3f
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 05:24:07 +00:00
dependabot[bot]
b3c75f973e build(deps): bump serde_json from 1.0.140 to 1.0.141
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.140 to 1.0.141.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.140...v1.0.141)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-version: 1.0.141
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 05:23:53 +00:00
tuna2134
e9529be559 Update dependabot.yml 2025-07-22 14:21:56 +09:00
tuna2134
a6694b5d81 Update dependabot.yml 2025-07-22 06:13:03 +09:00
tuna2134
096859de66 Merge pull request #209 from neodyland/dependabot/cargo/num_cpus-1.17.0
Bump num_cpus from 1.16.0 to 1.17.0
2025-07-21 12:27:18 +09:00
tuna2134
dabdc6712f Merge pull request #224 from neodyland/main
merge test
2025-07-21 12:27:08 +09:00
tuna2134
45c3255a91 Merge pull request #221 from neodyland/dependabot/cargo/ort-1e6f7ee
build(deps): bump ort from `af63cea` to `1e6f7ee`
2025-07-21 11:48:27 +09:00
tuna2134
bf39890b3d Merge pull request #223 from neodyland/main
Check fail
2025-07-21 11:48:10 +09:00
tuna2134
120bc608d7 Merge pull request #217 from neodyland/dependabot/cargo/tokenizers-0.21.2
build(deps): bump tokenizers from 0.21.1 to 0.21.2
2025-07-21 11:44:43 +09:00
tuna2134
2fc547e38b Merge pull request #222 from neodyland/main
merge
2025-07-21 11:42:01 +09:00
tuna2134
98ddaa3c58 format by cargo fmt 2025-07-21 11:38:11 +09:00
dependabot[bot]
656e405cd7 build(deps): bump ort from af63cea to 1e6f7ee
Bumps [ort](https://github.com/pykeio/ort) from `af63cea` to `1e6f7ee`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](af63cea854...1e6f7ee1c8)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: 1e6f7ee1c8b056b00d280167ba172c96e78fcd1c
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 09:44:51 +00:00
tuna2134
9d6aa46fdf Merge pull request #220 from neodyland/dependabot/cargo/tokio-1.46.1 2025-07-07 19:38:53 +09:00
dependabot[bot]
2fe90c6ede build(deps): bump tokio from 1.45.1 to 1.46.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.45.1 to 1.46.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.45.1...tokio-1.46.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.46.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-07 09:11:15 +00:00
dependabot[bot]
7faba2447b build(deps): bump tokenizers from 0.21.1 to 0.21.2
Bumps [tokenizers](https://github.com/huggingface/tokenizers) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/huggingface/tokenizers/releases)
- [Changelog](https://github.com/huggingface/tokenizers/blob/main/RELEASE.md)
- [Commits](https://github.com/huggingface/tokenizers/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: tokenizers
  dependency-version: 0.21.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-30 09:33:46 +00:00
tuna2134
02ac0885e0 Merge pull request #216 from neodyland/dependabot/cargo/utoipa-5.4.0
Bump utoipa from 5.3.1 to 5.4.0
2025-06-23 18:13:42 +09:00
tuna2134
1f96b09f3b Merge pull request #215 from neodyland/dependabot/cargo/ort-af63cea
Bump ort from `fd73862` to `af63cea`
2025-06-23 18:13:31 +09:00
tuna2134
d583c1ca1c Merge pull request #214 from neodyland/dependabot/cargo/ureq-3.0.12
Bump ureq from 3.0.11 to 3.0.12
2025-06-23 18:13:19 +09:00
dependabot[bot]
c135aac852 Bump utoipa from 5.3.1 to 5.4.0
Bumps [utoipa](https://github.com/juhaku/utoipa) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/juhaku/utoipa/releases)
- [Changelog](https://github.com/juhaku/utoipa/blob/master/utoipa-rapidoc/CHANGELOG.md)
- [Commits](https://github.com/juhaku/utoipa/compare/utoipa-5.3.1...utoipa-5.4.0)

---
updated-dependencies:
- dependency-name: utoipa
  dependency-version: 5.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 09:01:28 +00:00
dependabot[bot]
f31fa1d4f9 Bump ort from fd73862 to af63cea
Bumps [ort](https://github.com/pykeio/ort) from `fd73862` to `af63cea`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](fd738622d7...af63cea854)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: af63cea8546438576f7fc32c935d779bf0882826
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 08:48:56 +00:00
dependabot[bot]
efec7cce14 Bump ureq from 3.0.11 to 3.0.12
Bumps [ureq](https://github.com/algesten/ureq) from 3.0.11 to 3.0.12.
- [Changelog](https://github.com/algesten/ureq/blob/main/CHANGELOG.md)
- [Commits](https://github.com/algesten/ureq/compare/3.0.11...3.0.12)

---
updated-dependencies:
- dependency-name: ureq
  dependency-version: 3.0.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 08:38:51 +00:00
tuna2134@コマリン親衛隊
61914129dc Merge pull request #212 from neodyland/dependabot/cargo/ort-fd73862
Bump ort from `2d49e05` to `fd73862`
2025-06-16 18:01:48 +09:00
tuna2134@コマリン親衛隊
97c63a2e23 Merge pull request #213 from neodyland/dependabot/cargo/pyo3-0.25.1
Bump pyo3 from 0.25.0 to 0.25.1
2025-06-16 18:01:38 +09:00
dependabot[bot]
3475f47305 Bump pyo3 from 0.25.0 to 0.25.1
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/v0.25.1/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.25.0...v0.25.1)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.25.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 08:20:04 +00:00
dependabot[bot]
5493b91a84 Bump ort from 2d49e05 to fd73862
Bumps [ort](https://github.com/pykeio/ort) from `2d49e05` to `fd73862`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](2d49e052dc...fd738622d7)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: fd738622d708d0b7da536812e20a9e63adeaa70d
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 08:16:14 +00:00
tuna2134@コマリン親衛隊
bca6d04e7b Merge pull request #211 from neodyland/dependabot/cargo/ort-2d49e05 2025-06-09 20:13:11 +09:00
dependabot[bot]
d44ebe873e Bump ort from d1ebde9 to 2d49e05
Bumps [ort](https://github.com/pykeio/ort) from `d1ebde9` to `2d49e05`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](d1ebde95d3...2d49e052dc)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: 2d49e052dc14134e7c28a7b3e0878870710cd759
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:04:14 +00:00
tuna2134@コマリン親衛隊
96b53d42cd Merge pull request #210 from neodyland/dependabot/cargo/ort-d1ebde9 2025-06-02 17:24:06 +09:00
dependabot[bot]
9765ef51d2 Bump ort from 4745bb3 to d1ebde9
Bumps [ort](https://github.com/pykeio/ort) from `4745bb3` to `d1ebde9`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](4745bb3a4a...d1ebde95d3)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: d1ebde95d386513fea836593815e8f86f7b96a85
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 08:07:32 +00:00
dependabot[bot]
655be55605 Bump num_cpus from 1.16.0 to 1.17.0
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-version: 1.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 08:06:11 +00:00
tuna2134@コマリン親衛隊
e68f58d698 Fix year 2025-05-27 07:25:04 +09:00
tuna2134@コマリン親衛隊
2124fe4650 Merge pull request #207 from neodyland/dependabot/cargo/ort-4745bb3 2025-05-27 06:57:31 +09:00
tuna2134@コマリン親衛隊
0217c0a4d5 Merge pull request #205 from neodyland/dependabot/cargo/tokio-1.45.1 2025-05-27 06:57:06 +09:00
tuna2134@コマリン親衛隊
1de09597f5 Merge pull request #206 from neodyland/dependabot/cargo/pyo3-0.25.0 2025-05-27 06:56:53 +09:00
tuna2134@コマリン親衛隊
38d86c9249 Merge pull request #208 from neodyland/dependabot/cargo/npyz-0.8.4 2025-05-27 06:56:34 +09:00
dependabot[bot]
ddc132b27b Bump npyz from 0.8.3 to 0.8.4
Bumps [npyz](https://github.com/ExpHP/npyz) from 0.8.3 to 0.8.4.
- [Changelog](https://github.com/ExpHP/npyz/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ExpHP/npyz/compare/0.8.3...0.8.4)

---
updated-dependencies:
- dependency-name: npyz
  dependency-version: 0.8.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 21:53:38 +00:00
dependabot[bot]
558cd24677 Bump ort from 90afc70 to 4745bb3
Bumps [ort](https://github.com/pykeio/ort) from `90afc70` to `4745bb3`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](90afc700d0...4745bb3a4a)

---
updated-dependencies:
- dependency-name: ort
  dependency-version: 4745bb3a4a1b5ab7f2c807b8989638627068cdf9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 21:52:29 +00:00
dependabot[bot]
6657b06786 Bump pyo3 from 0.24.2 to 0.25.0
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.24.2 to 0.25.0.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.24.2...v0.25.0)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 21:52:04 +00:00
dependabot[bot]
2a8c9bafde Bump tokio from 1.45.0 to 1.45.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.45.0 to 1.45.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.45.0...tokio-1.45.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.45.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 21:51:36 +00:00
tuna2134@コマリン親衛隊
d7065ac6eb Merge pull request #204 from neodyland/tuna2134-patch-2
add: dependabot
2025-05-27 06:48:32 +09:00
tuna2134@コマリン親衛隊
0b1dbe4991 Create dependabot.yml 2025-05-27 06:47:06 +09:00
googlefan256
1ad588bfcf hotfix: path miss 2025-05-10 11:33:07 +09:00
googlefan256
9733ba95fa fix: the unknown error 2025-05-09 20:28:04 +09:00
googlefan256
843c16995c fix: cuda typo 2025-05-09 20:19:30 +09:00
googlefan256
f0821ea957 Merge pull request #201 from neodyland/googlefan256/fix-lot
fix: lot of
2025-05-09 20:10:08 +09:00
googlefan256
abc9cec7c7 fix: reduced actions 2025-05-09 20:07:18 +09:00
googlefan256
19e6b7f0e6 fix: ci 2025-05-09 20:05:46 +09:00
googlefan256
451f4497b6 fix: lot of 2025-05-09 17:01:02 +09:00
tuna2134@コマリン親衛隊
e5e92f6211 Merge pull request #141 from neodyland/renovate/typescript-5.x-lockfile
chore(deps): update dependency typescript to v5.8.3
2025-04-28 16:10:28 +09:00
tuna2134@コマリン親衛隊
b835577325 Merge pull request #190 from neodyland/renovate/anyhow-1.x-lockfile
chore(deps): update rust crate anyhow to v1.0.98
2025-04-28 16:08:54 +09:00
tuna2134@コマリン親衛隊
3caf93441a Merge pull request #191 from neodyland/renovate/thiserror-2.x-lockfile
fix(deps): update rust crate thiserror to v2.0.12
2025-04-28 16:08:30 +09:00
tuna2134@コマリン親衛隊
4deefc596b Merge pull request #192 from neodyland/renovate/serde_json-1.x-lockfile
fix(deps): update rust crate serde_json to v1.0.140
2025-04-22 06:42:24 +09:00
tuna2134@コマリン親衛隊
9174aa9b11 Merge pull request #196 from neodyland/renovate/pyo3-0.x
fix(deps): update rust crate pyo3 to 0.24.0
2025-04-22 06:33:40 +09:00
tuna2134@コマリン親衛隊
6bccf0468b Merge pull request #199 from neodyland/renovate/env_logger-0.x-lockfile
chore(deps): update rust crate env_logger to v0.11.8
2025-04-22 06:33:22 +09:00
tuna2134@コマリン親衛隊
bbb3f0003b Merge pull request #200 from neodyland/renovate/ureq-3.x-lockfile
chore(deps): update rust crate ureq to v3.0.11
2025-04-22 06:33:02 +09:00
googlefan256
46de7a9d3f Update README.md for notice 2025-04-18 09:47:02 +09:00
renovate[bot]
252b27de48 chore(deps): update rust crate ureq to v3.0.11 2025-04-15 22:47:28 +00:00
renovate[bot]
1dd3e02562 chore(deps): update rust crate anyhow to v1.0.98 2025-04-14 03:33:49 +00:00
renovate[bot]
4990261ecd chore(deps): update dependency typescript to v5.8.3 2025-04-05 01:50:04 +00:00
renovate[bot]
e873892223 chore(deps): update rust crate env_logger to v0.11.8 2025-04-01 22:07:52 +00:00
renovate[bot]
4255e15748 fix(deps): update rust crate pyo3 to 0.24.0 2025-03-10 03:15:24 +00:00
renovate[bot]
8bf3906105 fix(deps): update rust crate serde_json to v1.0.140 2025-03-03 11:01:43 +00:00
renovate[bot]
1d80eda325 fix(deps): update rust crate thiserror to v2.0.12 2025-03-03 06:07:28 +00:00
30 changed files with 925 additions and 524 deletions

15
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "cargo" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@@ -1,4 +1,4 @@
name: CI
name: Build
on:
push:
@@ -6,7 +6,6 @@ on:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
@@ -29,7 +28,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: docker build . -f .github/workflows/CI.Dockerfile --tag ci
- run: docker build . -f .github/workflows/build.Dockerfile --tag ci
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
@@ -111,6 +110,7 @@ jobs:
with:
name: wheels-sdist
path: ./crates/sbv2_bindings/dist
python-wheel:
name: Wheel Upload
runs-on: ubuntu-latest

26
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Lint
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
components:
- rustfmt
- clippy
steps:
- name: Setup
uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: ${{ matrix.components }}
- name: Format
if: ${{ matrix.components == 'rustfmt' }}
run: cargo fmt --all -- --check
- name: Lint
if: ${{ matrix.components == 'clippy' }}
run: cargo clippy --all-targets --all-features -- -D warnings

967
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["./crates/sbv2_api", "./crates/sbv2_core", "./crates/sbv2_bindings", "./crates/sbv2_wasm", "crates/sbv2_editor"]
resolver = "3"
members = ["./crates/sbv2_api", "./crates/sbv2_core", "./crates/sbv2_bindings", "./crates/sbv2_wasm"]
[workspace.package]
version = "0.2.0-alpha6"
@@ -8,11 +8,11 @@ edition = "2021"
description = "Style-Bert-VITSの推論ライブラリ"
license = "MIT"
readme = "./README.md"
repository = "https://github.com/tuna2134/sbv2-api"
repository = "https://github.com/neodyland/sbv2-api"
documentation = "https://docs.rs/sbv2_core"
[workspace.dependencies]
anyhow = "1.0.96"
anyhow = "1.0.99"
dotenvy = "0.15.7"
env_logger = "0.11.6"
ndarray = "0.16.1"

View File

@@ -1,6 +1,7 @@
MIT License
Copyright (c) 2024 tuna2134
Copyright (c) 2025- neodyland
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,14 +1,23 @@
# SBV2-API
## 注意:本バージョンはアルファ版です。
安定版を利用したい場合は[こちら](https://github.com/tuna2134/sbv2-api/tree/v0.1.x)をご覧ください
> [!CAUTION]
> 本バージョンはアルファ版です
>
> 安定版を利用したい場合は[こちら](https://github.com/neodyland/sbv2-api/tree/v0.1.x)をご覧ください。
## 注意: オプションの辞書はLGPLです。
オプションの辞書を使用する場合、バイナリの内部の辞書部分について、LGPLが適用されます。
> [!CAUTION]
> オプションの辞書はLGPLです。
>
> オプションの辞書を使用する場合、バイナリの内部の辞書部分について、LGPLが適用されます。
> [!NOTE]
> このレポジトリはメンテナンスの都合上、[tuna2134](https:://github.com/tuna2134)氏の所属する[Neodyland](https://neody.land/)へとリポジトリ所在地を移動しました。
>
> 引き続きtuna2134氏がメインメンテナとして管理しています。
## プログラミングに詳しくない方向け
[こちら](https://github.com/tuna2134/sbv2-gui?tab=readme-ov-file)を参照してください。
[こちら](https://github.com/tuna2134/sbv2-gui)を参照してください。
コマンドやpythonの知識なしで簡単に使えるバージョンです。(できることはほぼ同じ)
@@ -20,7 +29,7 @@ JP-Extra しか対応していません。(基本的に対応する予定もあ
## 変換方法
[こちら](https://github.com/tuna2134/sbv2-api/tree/main/scripts/convert)を参照してください。
[こちら](https://github.com/neodyland/sbv2-api/tree/main/scripts/convert)を参照してください。
## Todo
@@ -66,7 +75,7 @@ CPUの場合は
```sh
docker run -it --rm -p 3000:3000 --name sbv2 \
-v ./models:/work/models --env-file .env \
ghcr.io/tuna2134/sbv2-api:cpu
ghcr.io/neodyland/sbv2-api:cpu
```
<details>
@@ -81,7 +90,7 @@ CPUの場合は
```bash
docker run --platform linux/amd64 -it --rm -p 3000:3000 --name sbv2 \
-v ./models:/work/models --env-file .env \
ghcr.io/tuna2134/sbv2-api:cpu
ghcr.io/neodyland/sbv2-api:cpu
```
</details>
@@ -90,7 +99,7 @@ CUDAの場合は
docker run -it --rm -p 3000:3000 --name sbv2 \
-v ./models:/work/models --env-file .env \
--gpus all \
ghcr.io/tuna2134/sbv2-api:cuda
ghcr.io/neodyland/sbv2-api:cuda
```
### 起動確認

View File

@@ -16,8 +16,8 @@ env_logger.workspace = true
log = "0.4.22"
sbv2_core = { version = "0.2.0-alpha6", path = "../sbv2_core", features = ["aivmx"] }
serde = { version = "1.0.210", features = ["derive"] }
tokio = { version = "1.40.0", features = ["full"] }
utoipa = { version = "5.0.0", features = ["axum_extras"] }
tokio = { version = "1.47.1", features = ["full"] }
utoipa = { version = "5.4.0", features = ["axum_extras"] }
utoipa-scalar = { version = "0.3.0", features = ["axum"] }
[features]

View File

@@ -53,12 +53,16 @@ struct SynthesizeRequest {
text: String,
ident: String,
#[serde(default = "sdp_default")]
#[schema(example = 0.0_f32)]
sdp_ratio: f32,
#[serde(default = "length_default")]
#[schema(example = 1.0_f32)]
length_scale: f32,
#[serde(default = "style_id_default")]
#[schema(example = 0_i32)]
style_id: i32,
#[serde(default = "speaker_id_default")]
#[schema(example = 0_i64)]
speaker_id: i64,
}

View File

@@ -16,7 +16,7 @@ crate-type = ["cdylib"]
[dependencies]
anyhow.workspace = true
ndarray.workspace = true
pyo3 = { version = "0.23.0", features = ["anyhow"] }
pyo3 = { version = "0.25.1", features = ["anyhow"] }
sbv2_core = { path = "../sbv2_core", features = ["std"], default-features = false }
[features]

View File

@@ -136,6 +136,7 @@ impl TTSModel {
/// -------
/// voice_data : bytes
/// 音声データ
#[allow(clippy::too_many_arguments)]
fn synthesize<'p>(
&'p mut self,
py: Python<'p>,

View File

@@ -16,16 +16,16 @@ env_logger.workspace = true
hound = "3.5.1"
jpreprocess = { version = "0.12.0", features = ["naist-jdic"] }
ndarray.workspace = true
npyz = { version = "0.8.3", optional = true }
num_cpus = "1.16.0"
npyz = { version = "0.8.4", optional = true }
num_cpus = "1.17.0"
once_cell.workspace = true
ort = { git = "https://github.com/pykeio/ort.git", version = "2.0.0-rc.9", optional = true }
regex = "1.10.6"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
serde_json = "1.0.142"
tar = "0.4.41"
thiserror = "2.0.11"
tokenizers = { version = "0.21.0", default-features = false }
thiserror = "2.0.15"
tokenizers = { version = "0.21.4", default-features = false }
zstd = "0.13.2"
[features]
@@ -44,4 +44,4 @@ base64 = ["dep:base64"]
[build-dependencies]
dirs = "6.0.0"
ureq = "3.0.6"
ureq = "3.1.0"

View File

@@ -5,21 +5,27 @@ use std::io::copy;
use std::path::PathBuf;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let static_path = home_dir().unwrap().join(".cache/sbv2/all.bin");
let static_dir = home_dir().unwrap().join(".cache/sbv2");
let static_path = static_dir.join("all.bin");
let out_path = PathBuf::from(&env::var("OUT_DIR").unwrap()).join("all.bin");
println!("cargo:rerun-if-changed=build.rs");
if static_path.exists() {
if fs::hard_link(&static_path, &out_path).is_err() {
fs::copy(static_path, out_path).unwrap();
};
println!("cargo:info=Dictionary file already exists, skipping download.");
} else {
println!("cargo:warning=Downloading dictionary file...");
let mut response =
ureq::get("https://huggingface.co/neody/sbv2-api-assets/resolve/main/dic/all.bin")
.call()?;
let mut response = response.body_mut().as_reader();
let mut file = fs::File::create(&out_path)?;
if !static_dir.exists() {
fs::create_dir_all(static_dir)?;
}
let mut file = fs::File::create(&static_path)?;
copy(&mut response, &mut file)?;
}
if !out_path.exists() && fs::hard_link(&static_path, &out_path).is_err() {
println!("cargo:warning=Failed to create hard link, copying instead.");
fs::copy(static_path, out_path)?;
}
Ok(())
}

View File

@@ -14,11 +14,9 @@ pub fn predict(
"attention_mask" => TensorRef::from_array_view((vec![1, attention_masks.len() as i64], attention_masks.as_slice()))?,
}
)?;
let output = outputs["output"]
.try_extract_tensor::<f32>()?
.try_extract_array::<f32>()?
.into_dimensionality::<Ix2>()?
.to_owned();
Ok(output)
}

View File

@@ -28,6 +28,8 @@ pub enum Error {
Base64Error(#[from] base64::DecodeError),
#[error("other")]
OtherError(String),
#[error("Style error: {0}")]
StyleError(String),
}
pub type Result<T> = std::result::Result<T, Error>;

View File

@@ -1,3 +1,175 @@
/*
このファイルのコードは
https://github.com/litagin02/Style-Bert-VITS2/blob/master/style_bert_vits2/nlp/japanese/g2p.py
を参考にRustに書き換えています。
以下はライセンスです。
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
*/
use crate::error::{Error, Result};
use crate::mora::{CONSONANTS, MORA_KATA_TO_MORA_PHONEMES, MORA_PHONEMES_TO_MORA_KATA, VOWELS};
use crate::norm::{replace_punctuation, PUNCTUATIONS};
@@ -81,7 +253,7 @@ fn phone_tone_to_kana(phones: Vec<String>, tones: Vec<i32>) -> Vec<(String, i32)
let tones = &tones[1..];
let mut results = Vec::new();
let mut current_mora = String::new();
for ((phone, next_phone), (&tone, &next_tone)) in phones
for ((phone, _next_phone), (&tone, &next_tone)) in phones
.iter()
.zip(phones.iter().skip(1))
.zip(tones.iter().zip(tones.iter().skip(1)))
@@ -123,24 +295,24 @@ impl JTalkProcess {
.map(|(_letter, tone)| *tone)
.collect();
if tone_values.len() == 1 {
assert!(tone_values == hash_set![0], "{:?}", tone_values);
assert!(tone_values == hash_set![0], "{tone_values:?}");
Ok(phone_tone_list)
} else if tone_values.len() == 2 {
if tone_values == hash_set![0, 1] {
return Ok(phone_tone_list);
Ok(phone_tone_list)
} else if tone_values == hash_set![-1, 0] {
return Ok(phone_tone_list
Ok(phone_tone_list
.iter()
.map(|x| {
let new_tone = if x.1 == -1 { 0 } else { 1 };
(x.0.clone(), new_tone)
})
.collect());
.collect())
} else {
return Err(Error::ValueError("Invalid tone values 0".to_string()));
Err(Error::ValueError("Invalid tone values 0".to_string()))
}
} else {
return Err(Error::ValueError("Invalid tone values 1".to_string()));
Err(Error::ValueError("Invalid tone values 1".to_string()))
}
}
@@ -226,12 +398,12 @@ impl JTalkProcess {
} else if PUNCTUATIONS.contains(&phone.as_str()) {
result.push((phone, 0));
} else {
println!("phones {:?}", phone_with_punct);
println!("phone_tone_list: {:?}", phone_tone_list);
println!("result: {:?}", result);
println!("tone_index: {:?}", tone_index);
println!("phone: {:?}", phone);
return Err(Error::ValueError(format!("Mismatched phoneme: {}", phone)));
println!("phones {phone_with_punct:?}");
println!("phone_tone_list: {phone_tone_list:?}");
println!("result: {result:?}");
println!("tone_index: {tone_index:?}");
println!("phone: {phone:?}");
return Err(Error::ValueError(format!("Mismatched phoneme: {phone}")));
}
}
@@ -276,8 +448,7 @@ impl JTalkProcess {
}
if !KATAKANA_PATTERN.is_match(&text) {
return Err(Error::ValueError(format!(
"Input must be katakana only: {}",
text
"Input must be katakana only: {text}"
)));
}
@@ -285,7 +456,7 @@ impl JTalkProcess {
let mora = mora.to_string();
let (consonant, vowel) = MORA_KATA_TO_MORA_PHONEMES.get(&mora).unwrap();
if consonant.is_none() {
text = text.replace(&mora, &format!(" {}", vowel));
text = text.replace(&mora, &format!(" {vowel}"));
} else {
text = text.replace(
&mora,
@@ -319,7 +490,7 @@ impl JTalkProcess {
let (string, pron) = self.parse_to_string_and_pron(parts.clone());
let mut yomi = pron.replace('', "");
let word = replace_punctuation(string);
assert!(!yomi.is_empty(), "Empty yomi: {}", word);
assert!(!yomi.is_empty(), "Empty yomi: {word}");
if yomi == "" {
if !word
.chars()
@@ -330,7 +501,7 @@ impl JTalkProcess {
yomi = word.clone();
}
} else if yomi == "" {
assert!(word == "?", "yomi `` comes from: {}", word);
assert!(word == "?", "yomi `` comes from: {word}");
yomi = "?".to_string();
}
seq_text.push(word);

View File

@@ -21,10 +21,7 @@ pub fn load_model<P: AsRef<[u8]>>(model_file: P, bert: bool) -> Result<Session>
#[cfg(feature = "cuda")]
{
#[allow(unused_mut)]
let mut cuda = ort::execution_providers::CUDAExecutionProvider::default()
.with_conv_algorithm_search(
ort::execution_providers::cuda::CUDAExecutionProviderCuDNNConvAlgoSearch::Default,
);
let mut cuda = ort::execution_providers::CUDAExecutionProvider::default();
#[cfg(feature = "cuda_tf32")]
{
cuda = cuda.with_tf32(true);
@@ -101,11 +98,9 @@ pub fn synthesize(
"noise_scale" => noise_scale,
"noise_scale_w" => noise_scale_w,
})?;
let audio_array = outputs["output"]
.try_extract_tensor::<f32>()?
.try_extract_array::<f32>()?
.into_dimensionality::<Ix3>()?
.to_owned();
Ok(audio_array)
}

View File

@@ -1,4 +1,4 @@
use crate::error::Result;
use crate::error::{Error, Result};
use ndarray::{s, Array1, Array2};
use serde::Deserialize;
@@ -21,6 +21,18 @@ pub fn get_style_vector(
style_id: i32,
weight: f32,
) -> Result<Array1<f32>> {
if style_vectors.shape().len() != 2 {
return Err(Error::StyleError(
"Invalid shape for style vectors".to_string(),
));
}
if style_id < 0 || style_id >= style_vectors.shape()[0] as i32 {
return Err(Error::StyleError(format!(
"Invalid style ID: {}. Max ID: {}",
style_id,
style_vectors.shape()[0] - 1
)));
}
let mean = style_vectors.slice(s![0, ..]).to_owned();
let style_vector = style_vectors.slice(s![style_id as usize, ..]).to_owned();
let diff = (style_vector - &mean) * weight;

View File

@@ -214,6 +214,7 @@ impl TTSModelHolder {
)
}
#[allow(clippy::type_complexity)]
pub fn parse_text_neo(
&mut self,
text: String,
@@ -239,39 +240,43 @@ impl TTSModelHolder {
}
fn find_and_load_model<I: Into<TTSIdent>>(&mut self, ident: I) -> Result<bool> {
let ident = ident.into();
let (bytes, style_vectors) = {
let model = self
// Locate target model entry
let target_index = self
.models
.iter()
.find(|m| m.ident == ident)
.position(|m| m.ident == ident)
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
if model.vits2.is_some() {
// Already loaded
if self.models[target_index].vits2.is_some() {
return Ok(true);
}
(model.bytes.clone().unwrap(), model.style_vectors.clone())
};
self.unload(ident.clone());
let s = model::load_model(&bytes, false)?;
// Get bytes to build a Session
let bytes = self.models[target_index]
.bytes
.clone()
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
// Enforce max loaded models by evicting a different loaded model's session, not removing the entry
if let Some(max) = self.max_loaded_models {
if self.models.iter().filter(|x| x.vits2.is_some()).count() >= max {
self.unload(self.models.first().unwrap().ident.clone());
}
}
self.models.push(TTSModel {
bytes: Some(bytes.to_vec()),
vits2: Some(s),
style_vectors,
ident: ident.clone(),
});
let model = self
let loaded_count = self.models.iter().filter(|m| m.vits2.is_some()).count();
if loaded_count >= max {
if let Some(evict_index) = self
.models
.iter()
.find(|m| m.ident == ident)
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
if model.vits2.is_some() {
return Ok(true);
.position(|m| m.vits2.is_some() && m.ident != ident)
{
// Drop only the session to free memory; keep bytes/style for future reload
self.models[evict_index].vits2 = None;
}
Err(Error::ModelNotFoundError(ident.to_string()))
}
}
// Build and set session in-place for the target model
let s = model::load_model(&bytes, false)?;
self.models[target_index].vits2 = Some(s);
Ok(true)
}
/// Get style vector by style id and weight

View File

@@ -173,8 +173,15 @@ pub fn parse_text_blocking(
}
pub fn array_to_vec(audio_array: Array3<f32>) -> Result<Vec<u8>> {
// If SBV2_FORCE_STEREO is set ("1"/"true"), duplicate mono to stereo
let force_stereo = std::env::var("SBV2_FORCE_STEREO")
.ok()
.map(|v| matches!(v.as_str(), "1" | "true" | "TRUE" | "True"))
.unwrap_or(false);
let channels: u16 = if force_stereo { 2 } else { 1 };
let spec = WavSpec {
channels: 1,
channels,
sample_rate: 44100,
bits_per_sample: 32,
sample_format: SampleFormat::Float,
@@ -183,10 +190,18 @@ pub fn array_to_vec(audio_array: Array3<f32>) -> Result<Vec<u8>> {
let mut writer = WavWriter::new(&mut cursor, spec)?;
for i in 0..audio_array.shape()[0] {
let output = audio_array.slice(s![i, 0, ..]).to_vec();
if force_stereo {
for sample in output {
// Write to Left and Right channels
writer.write_sample(sample)?;
writer.write_sample(sample)?;
}
} else {
for sample in output {
writer.write_sample(sample)?;
}
}
}
writer.finalize()?;
Ok(cursor.into_inner())
}

View File

@@ -1,2 +1,2 @@
# StyleBertVITS2 wasm
refer to https://github.com/tuna2134/sbv2-api
refer to https://github.com/neodyland/sbv2-api

View File

@@ -11,6 +11,7 @@
},
"keywords": [],
"author": "tuna2134",
"contributes": ["neodyland"],
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "^1.9.4",

View File

@@ -23,7 +23,7 @@ importers:
version: 0.25.0
typescript:
specifier: ^5.7.3
version: 5.7.3
version: 5.8.3
packages:
@@ -290,8 +290,8 @@ packages:
resolution: {integrity: sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==}
engines: {node: '>=12.0.0'}
typescript@5.7.3:
resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==}
typescript@5.8.3:
resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==}
engines: {node: '>=14.17'}
hasBin: true
@@ -499,6 +499,6 @@ snapshots:
'@types/node': 22.13.5
long: 5.3.1
typescript@5.7.3: {}
typescript@5.8.3: {}
undici-types@6.20.0: {}

View File

@@ -0,0 +1 @@
3.11

View File

@@ -1,5 +1,6 @@
style-bert-vits2
git+https://github.com/neodyland/style-bert-vits2-ref
onnxsim
numpy<2
zstandard
onnxruntime
cmake<4

View File

@@ -2,8 +2,16 @@ FROM rust AS builder
WORKDIR /work
COPY . .
RUN cargo build -r --bin sbv2_api
FROM gcr.io/distroless/cc-debian12
FROM ubuntu AS upx
WORKDIR /work
RUN apt update && apt-get install -y upx binutils
COPY --from=builder /work/target/release/sbv2_api /work/main
COPY --from=builder /work/target/release/*.so /work
RUN upx --best --lzma /work/main
RUN find /work -maxdepth 1 -name "*.so" -exec strip --strip-unneeded {} +
RUN find /work -maxdepth 1 -name "*.so" -exec upx --best --lzma {} +
FROM gcr.io/distroless/cc-debian12
WORKDIR /work
COPY --from=upx /work/main /work/main
COPY --from=upx /work/*.so /work
CMD ["/work/main"]

View File

@@ -2,9 +2,16 @@ FROM rust AS builder
WORKDIR /work
COPY . .
RUN cargo build -r --bin sbv2_api -F cuda,cuda_tf32
FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04
FROM ubuntu AS upx
WORKDIR /work
RUN apt update && apt-get install -y upx binutils
COPY --from=builder /work/target/release/sbv2_api /work/main
COPY --from=builder /work/target/release/*.so /work
RUN upx --best --lzma /work/main
RUN find /work -maxdepth 1 -name "*.so" -exec strip --strip-unneeded {} +
FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04
WORKDIR /work
COPY --from=upx /work/main /work/main
COPY --from=upx /work/*.so /work
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/work
CMD ["/work/main"]

View File

@@ -1,3 +1,3 @@
docker run -it --rm -p 3000:3000 --name sbv2 \
-v ./models:/work/models --env-file .env \
ghcr.io/tuna2134/sbv2-api:cpu
ghcr.io/neodyland/sbv2-api:cpu

View File

@@ -1,4 +1,4 @@
docker run -it --rm -p 3000:3000 --name sbv2 \
-v ./models:/work/models --env-file .env \
--gpus all \
ghcr.io/tuna2134/sbv2-api:cuda
ghcr.io/neodyland/sbv2-api:cuda