Compare commits

..

19 Commits

Author SHA1 Message Date
tuna2134
f98c6b8226 Merge pull request #245 from neodyland/dependabot/cargo/tokenizers-0.22.0
build(deps): bump tokenizers from 0.21.4 to 0.22.0
2025-09-02 06:26:10 +09:00
tuna2134
043f380c75 Merge pull request #246 from neodyland/dependabot/cargo/pyo3-0.26.0
build(deps): bump pyo3 from 0.25.1 to 0.26.0
2025-09-02 06:25:57 +09:00
tuna2134
703035cc47 Merge pull request #247 from neodyland/dependabot/cargo/ort-c162a72
build(deps): bump ort from `f7f5711` to `c162a72`
2025-09-02 06:25:43 +09:00
dependabot[bot]
fcfff9395b build(deps): bump ort from f7f5711 to c162a72
Bumps [ort](https://github.com/pykeio/ort) from `f7f5711` to `c162a72`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](f7f571173b...c162a72a38)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 15:04:27 +00:00
dependabot[bot]
0cbb6783cf build(deps): bump pyo3 from 0.25.1 to 0.26.0
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.25.1 to 0.26.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.25.1...v0.26.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 14:24:39 +00:00
dependabot[bot]
37477c1e30 build(deps): bump tokenizers from 0.21.4 to 0.22.0
Bumps [tokenizers](https://github.com/huggingface/tokenizers) from 0.21.4 to 0.22.0.
- [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.4...v0.22.0)

---
updated-dependencies:
- dependency-name: tokenizers
  dependency-version: 0.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 14:17:04 +00:00
tuna2134
93c121da95 fix: update package version to 0.2.0-alpha8 2025-09-01 06:22:24 +09:00
tuna2134
69d2857d11 Merge pull request #243 from neodyland/dependabot/cargo/ort-f7f5711
build(deps): bump ort from `d269461` to `f7f5711`
2025-09-01 06:20:56 +09:00
tuna2134
5cb4480ac7 Merge pull request #241 from neodyland/dependabot/cargo/regex-1.11.2
build(deps): bump regex from 1.11.1 to 1.11.2
2025-09-01 06:17:36 +09:00
tuna2134
3553d01a7f Merge pull request #242 from neodyland/dependabot/cargo/serde_json-1.0.143
build(deps): bump serde_json from 1.0.142 to 1.0.143
2025-09-01 06:17:25 +09:00
tuna2134
91ac2fad78 Merge pull request #244 from neodyland/dependabot/cargo/thiserror-2.0.16
build(deps): bump thiserror from 2.0.15 to 2.0.16
2025-09-01 06:17:04 +09:00
tuna2134
ebcb6f9081 fix: update conditional check for aivm_style_vectors metadata 2025-09-01 06:16:28 +09:00
tuna2134
e47f57ade5 feat 2025-08-28 23:48:38 +09:00
dependabot[bot]
605ea12450 build(deps): bump thiserror from 2.0.15 to 2.0.16
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.15 to 2.0.16.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.15...2.0.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 15:21:03 +00:00
dependabot[bot]
ef8b2d829c build(deps): bump ort from d269461 to f7f5711
Bumps [ort](https://github.com/pykeio/ort) from `d269461` to `f7f5711`.
- [Release notes](https://github.com/pykeio/ort/releases)
- [Commits](d269461e21...f7f571173b)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 15:06:59 +00:00
dependabot[bot]
2aa43e0e3d build(deps): bump serde_json from 1.0.142 to 1.0.143
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.142 to 1.0.143.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.142...v1.0.143)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 14:26:58 +00:00
dependabot[bot]
ef071f2b55 build(deps): bump regex from 1.11.1 to 1.11.2
Bumps [regex](https://github.com/rust-lang/regex) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.1...1.11.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 14:12:40 +00:00
tuna2134
dc5fa88432 write license 2025-08-21 12:15:22 +09:00
tuna2134
a5f45cd2ef fix: license 2025-08-21 12:14:44 +09:00
7 changed files with 211 additions and 40 deletions

65
Cargo.lock generated
View File

@@ -1412,7 +1412,7 @@ dependencies = [
"reqwest",
"serde",
"tar",
"thiserror 2.0.15",
"thiserror 2.0.16",
"yada",
]
@@ -1740,7 +1740,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ort"
version = "2.0.0-rc.10"
source = "git+https://github.com/pykeio/ort.git#d269461e2130b407589feff404025df25faeb3bb"
source = "git+https://github.com/pykeio/ort.git#c162a72a3878d2c54ffd109f6389db5d92411631"
dependencies = [
"libloading",
"ndarray",
@@ -1752,7 +1752,7 @@ dependencies = [
[[package]]
name = "ort-sys"
version = "2.0.0-rc.10"
source = "git+https://github.com/pykeio/ort.git#d269461e2130b407589feff404025df25faeb3bb"
source = "git+https://github.com/pykeio/ort.git#c162a72a3878d2c54ffd109f6389db5d92411631"
dependencies = [
"flate2",
"pkg-config",
@@ -1812,7 +1812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6"
dependencies = [
"memchr",
"thiserror 2.0.15",
"thiserror 2.0.16",
"ucd-trie",
]
@@ -1967,9 +1967,9 @@ dependencies = [
[[package]]
name = "pyo3"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
dependencies = [
"anyhow",
"indoc",
@@ -1985,19 +1985,18 @@ dependencies = [
[[package]]
name = "pyo3-build-config"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
dependencies = [
"once_cell",
"target-lexicon",
]
[[package]]
name = "pyo3-ffi"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
dependencies = [
"libc",
"pyo3-build-config",
@@ -2005,9 +2004,9 @@ dependencies = [
[[package]]
name = "pyo3-macros"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
@@ -2017,9 +2016,9 @@ dependencies = [
[[package]]
name = "pyo3-macros-backend"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
dependencies = [
"heck",
"proc-macro2",
@@ -2141,14 +2140,14 @@ checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b"
dependencies = [
"getrandom 0.2.16",
"libredox",
"thiserror 2.0.15",
"thiserror 2.0.16",
]
[[package]]
name = "regex"
version = "1.11.1"
version = "1.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
dependencies = [
"aho-corasick",
"memchr",
@@ -2308,7 +2307,7 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "sbv2_api"
version = "0.2.0-alpha6"
version = "0.2.0-alpha8"
dependencies = [
"anyhow",
"axum",
@@ -2324,7 +2323,7 @@ dependencies = [
[[package]]
name = "sbv2_bindings"
version = "0.2.0-alpha6"
version = "0.2.0-alpha8"
dependencies = [
"anyhow",
"ndarray",
@@ -2334,7 +2333,7 @@ dependencies = [
[[package]]
name = "sbv2_core"
version = "0.2.0-alpha6"
version = "0.2.0-alpha8"
dependencies = [
"anyhow",
"base64 0.22.1",
@@ -2352,7 +2351,7 @@ dependencies = [
"serde",
"serde_json",
"tar",
"thiserror 2.0.15",
"thiserror 2.0.16",
"tokenizers",
"ureq",
"zstd",
@@ -2360,7 +2359,7 @@ dependencies = [
[[package]]
name = "sbv2_wasm"
version = "0.2.0-alpha6"
version = "0.2.0-alpha8"
dependencies = [
"js-sys",
"ndarray",
@@ -2430,9 +2429,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.142"
version = "1.0.143"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
dependencies = [
"itoa",
"memchr",
@@ -2710,11 +2709,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.15"
version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d76d3f064b981389ecb4b6b7f45a0bf9fdac1d5b9204c7bd6714fecc302850"
checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0"
dependencies = [
"thiserror-impl 2.0.15",
"thiserror-impl 2.0.16",
]
[[package]]
@@ -2730,9 +2729,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.15"
version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d29feb33e986b6ea906bd9c3559a856983f92371b3eaa5e83782a351623de0"
checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960"
dependencies = [
"proc-macro2",
"quote",
@@ -2766,9 +2765,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokenizers"
version = "0.21.4"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a620b996116a59e184c2fa2dfd8251ea34a36d0a514758c6f966386bd2e03476"
checksum = "af10f51be57162b69d90a15cb226eef12c9e4faecbd5e3ea98a86bfb920b3d71"
dependencies = [
"ahash",
"aho-corasick",
@@ -2793,7 +2792,7 @@ dependencies = [
"serde",
"serde_json",
"spm_precompiled",
"thiserror 2.0.15",
"thiserror 2.0.16",
"unicode-normalization-alignments",
"unicode-segmentation",
"unicode_categories",

View File

@@ -3,7 +3,7 @@ resolver = "3"
members = ["./crates/sbv2_api", "./crates/sbv2_core", "./crates/sbv2_bindings", "./crates/sbv2_wasm"]
[workspace.package]
version = "0.2.0-alpha6"
version = "0.2.0-alpha8"
edition = "2021"
description = "Style-Bert-VITSの推論ライブラリ"
license = "MIT"

View File

View File

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

View File

@@ -20,12 +20,12 @@ 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"
regex = "1.11.2"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.142"
serde_json = "1.0.143"
tar = "0.4.41"
thiserror = "2.0.15"
tokenizers = { version = "0.21.4", default-features = false }
thiserror = "2.0.16"
tokenizers = { version = "0.22.0", default-features = false }
zstd = "0.13.2"
[features]

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};

View File

@@ -91,7 +91,7 @@ impl TTSModelHolder {
}
let model = model::load_model(&aivmx_bytes, false)?;
let metadata = model.metadata()?;
if let Some(aivm_style_vectors) = metadata.custom("aivm_style_vectors")? {
if let Some(aivm_style_vectors) = metadata.custom("aivm_style_vectors") {
let aivm_style_vectors = BASE64_STANDARD.decode(aivm_style_vectors)?;
let style_vectors = Cursor::new(&aivm_style_vectors);
let reader = npyz::NpyFile::new(style_vectors)?;