Compare commits

..

1 Commits

Author SHA1 Message Date
tuna2134
159f58026d release v0.2.0-alpha7 2025-07-21 11:58:37 +09:00
8 changed files with 35 additions and 64 deletions

View File

@@ -9,7 +9,3 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

4
.gitignore vendored
View File

@@ -1,10 +1,10 @@
target/
models/
!models/.gitkeep
venv/
.venv/
.env
*.wav
node_modules/
dist/
*.csv
*.bin
*.bin

48
Cargo.lock generated
View File

@@ -871,9 +871,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.5.1"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08"
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
[[package]]
name = "hound"
@@ -995,7 +995,7 @@ dependencies = [
"hyper",
"libc",
"pin-project-lite",
"socket2 0.5.9",
"socket2",
"tokio",
"tower-service",
"tracing",
@@ -1636,9 +1636,9 @@ dependencies = [
[[package]]
name = "num_cpus"
version = "1.17.0"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
"hermit-abi",
"libc",
@@ -1740,7 +1740,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ort"
version = "2.0.0-rc.10"
source = "git+https://github.com/pykeio/ort.git#5f96a2d5857c3fe9f06282dbf4bdcddbca6c5fe6"
source = "git+https://github.com/pykeio/ort.git#1e6f7ee1c8b056b00d280167ba172c96e78fcd1c"
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#5f96a2d5857c3fe9f06282dbf4bdcddbca6c5fe6"
source = "git+https://github.com/pykeio/ort.git#1e6f7ee1c8b056b00d280167ba172c96e78fcd1c"
dependencies = [
"flate2",
"pkg-config",
@@ -2308,7 +2308,7 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "sbv2_api"
version = "0.2.0-alpha6"
version = "0.2.0-alpha7"
dependencies = [
"anyhow",
"axum",
@@ -2324,7 +2324,7 @@ dependencies = [
[[package]]
name = "sbv2_bindings"
version = "0.2.0-alpha6"
version = "0.2.0-alpha7"
dependencies = [
"anyhow",
"ndarray",
@@ -2334,7 +2334,7 @@ dependencies = [
[[package]]
name = "sbv2_core"
version = "0.2.0-alpha6"
version = "0.2.0-alpha7"
dependencies = [
"anyhow",
"base64 0.22.1",
@@ -2360,7 +2360,7 @@ dependencies = [
[[package]]
name = "sbv2_wasm"
version = "0.2.0-alpha6"
version = "0.2.0-alpha7"
dependencies = [
"js-sys",
"ndarray",
@@ -2430,9 +2430,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.142"
version = "1.0.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
dependencies = [
"itoa",
"memchr",
@@ -2538,16 +2538,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "socket2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
dependencies = [
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "socks"
version = "0.3.4"
@@ -2766,9 +2756,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokenizers"
version = "0.21.4"
version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a620b996116a59e184c2fa2dfd8251ea34a36d0a514758c6f966386bd2e03476"
checksum = "4c3846d8588abed0daba25a0e47edd58ea15e450a6088b2575f5116fdb0b27ca"
dependencies = [
"ahash",
"aho-corasick",
@@ -2801,9 +2791,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.47.1"
version = "1.46.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
dependencies = [
"backtrace",
"bytes",
@@ -2814,9 +2804,9 @@ dependencies = [
"pin-project-lite",
"signal-hook-registry",
"slab",
"socket2 0.6.0",
"socket2",
"tokio-macros",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]

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-alpha7"
edition = "2021"
description = "Style-Bert-VITSの推論ライブラリ"
license = "MIT"

View File

@@ -16,7 +16,7 @@ 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.47.1", features = ["full"] }
tokio = { version = "1.46.1", features = ["full"] }
utoipa = { version = "5.4.0", features = ["axum_extras"] }
utoipa-scalar = { version = "0.3.0", features = ["axum"] }

View File

@@ -17,15 +17,15 @@ hound = "3.5.1"
jpreprocess = { version = "0.12.0", features = ["naist-jdic"] }
ndarray.workspace = true
npyz = { version = "0.8.4", optional = true }
num_cpus = "1.17.0"
num_cpus = "1.16.0"
once_cell.workspace = true
ort = { git = "https://github.com/pykeio/ort.git", version = "2.0.0-rc.9", optional = true }
ort = { git = "https://github.com/pykeio/ort.git", version = "2.0.0-rc.10", optional = true }
regex = "1.10.6"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.142"
serde_json = "1.0.128"
tar = "0.4.41"
thiserror = "2.0.11"
tokenizers = { version = "0.21.4", default-features = false }
tokenizers = { version = "0.21.2", default-features = false }
zstd = "0.13.2"
[features]

View File

@@ -127,20 +127,20 @@ impl JTalkProcess {
Ok(phone_tone_list)
} else if tone_values.len() == 2 {
if tone_values == hash_set![0, 1] {
Ok(phone_tone_list)
return Ok(phone_tone_list);
} else if tone_values == hash_set![-1, 0] {
Ok(phone_tone_list
return 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 {
Err(Error::ValueError("Invalid tone values 0".to_string()))
return Err(Error::ValueError("Invalid tone values 0".to_string()));
}
} else {
Err(Error::ValueError("Invalid tone values 1".to_string()))
return Err(Error::ValueError("Invalid tone values 1".to_string()));
}
}

View File

@@ -173,15 +173,8 @@ 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,
channels: 1,
sample_rate: 44100,
bits_per_sample: 32,
sample_format: SampleFormat::Float,
@@ -190,16 +183,8 @@ 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)?;
}
for sample in output {
writer.write_sample(sample)?;
}
}
writer.finalize()?;