Skip to content

Commit 8bb029e

Browse files
authored
Feat/zipvoice1 (#116)
* Update sherpa-rs and sherpa-rs-sys to version 0.6.8 in Cargo.toml and Cargo.lock * add zipvoice * Remove sherpa-onnx-zipvoice-distill-zh-en-emilia folder from Git tracking * update sherpa * fmt * fix warnings * clippy * update dist.json to version v1.12.15
1 parent 6700749 commit 8bb029e

25 files changed

+358
-110
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ matcha-*
3232
crates/sherpa-rs-sys/sherpa-onnx/scripts/
3333
kokoro-multi-lang-v1_0/
3434
kitten-nano-en-*/
35+
sherpa-onnx-zipvoice-*/

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sherpa-rs-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sherpa-rs-sys"
3-
version = "0.6.7"
3+
version = "0.6.8"
44
edition = "2021"
55
authors = ["thewh1teagle"]
66
homepage = "https://github.com/thewh1teagle/sherpa-rs"

crates/sherpa-rs-sys/build.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ lazy_static::lazy_static! {
3333
fn link_lib(lib: &str, is_dynamic: bool) {
3434
let lib_kind = if is_dynamic { "dylib" } else { "static" };
3535
debug_log!("cargo:rustc-link-lib={}={}", lib_kind, lib);
36-
println!("cargo:rustc-link-lib={}={}", lib_kind, lib);
36+
println!("cargo:rustc-link-lib={lib_kind}={lib}");
3737
}
3838

3939
fn link_framework(framework: &str) {
4040
debug_log!("cargo:rustc-link-lib=framework={}", framework);
41-
println!("cargo:rustc-link-lib=framework={}", framework);
41+
println!("cargo:rustc-link-lib=framework={framework}");
4242
}
4343

4444
fn add_search_path<P: AsRef<Path>>(path: P) {
@@ -141,7 +141,7 @@ fn extract_lib_names(out_dir: &Path, is_dynamic: bool, target_os: &str) -> Vec<S
141141
};
142142
lib_names.push(lib_name.to_string());
143143
}
144-
Err(e) => println!("cargo:warning=error={}", e),
144+
Err(e) => println!("cargo:warning=error={e}"),
145145
}
146146
}
147147
lib_names
@@ -166,7 +166,7 @@ fn extract_lib_assets(out_dir: &Path, target_os: &str) -> Vec<PathBuf> {
166166
Ok(path) => {
167167
files.push(path);
168168
}
169-
Err(e) => eprintln!("cargo:warning=error={}", e),
169+
Err(e) => eprintln!("cargo:warning=error={e}"),
170170
}
171171
}
172172

@@ -189,7 +189,7 @@ fn macos_link_search_path() -> Option<String> {
189189
for line in stdout.lines() {
190190
if line.contains("libraries: =") {
191191
let path = line.split('=').nth(1)?;
192-
return Some(format!("{}/lib/darwin", path));
192+
return Some(format!("{path}/lib/darwin"));
193193
}
194194
}
195195

@@ -199,13 +199,13 @@ fn macos_link_search_path() -> Option<String> {
199199

200200
fn rerun_on_env_changes(vars: &[&str]) {
201201
for env in vars {
202-
println!("cargo::rerun-if-env-changed={}", env);
202+
println!("cargo::rerun-if-env-changed={env}");
203203
}
204204
}
205205

206206
fn rerun_if_changed(vars: &[&str]) {
207207
for var in vars {
208-
println!("cargo:rerun-if-changed={}", var);
208+
println!("cargo:rerun-if-changed={var}");
209209
}
210210
}
211211

@@ -218,17 +218,16 @@ fn verify_checksum(actual_hash: &str, expected_hash: &str) {
218218
if actual_hash != expected_hash {
219219
panic!(
220220
"Checksum validation failed!\n\
221-
Expected: {}\n\
222-
Got: {}\n\
221+
Expected: {expected_hash}\n\
222+
Got: {actual_hash}\n\
223223
\n\
224224
This usually means the downloaded file is corrupted or has been tampered with.\n\
225225
\n\
226226
Possible solutions:\n\
227227
1. Try cleaning the cache and rebuilding: cargo clean && cargo build\n\
228228
2. Check your internet connection and try again\n\
229229
3. If you trust the source and want to bypass validation (NOT RECOMMENDED):\n\
230-
UNSAFE_DISABLE_CHECKSUM_VALIDATION=1 cargo build",
231-
expected_hash, actual_hash
230+
UNSAFE_DISABLE_CHECKSUM_VALIDATION=1 cargo build"
232231
);
233232
}
234233
}
@@ -329,7 +328,7 @@ fn main() {
329328
// Explicitly set target in case we are cross-compiling.
330329
// See https://github.com/rust-lang/rust-bindgen/issues/1780 for context.
331330
debug_log!("mapped clang target: {}", clang_target);
332-
bindings_builder = bindings_builder.clang_arg(format!("--target={}", clang_target));
331+
bindings_builder = bindings_builder.clang_arg(format!("--target={clang_target}"));
333332
}
334333

335334
debug_log!("Generating bindings...");

crates/sherpa-rs-sys/checksum.txt

Lines changed: 81 additions & 85 deletions
Large diffs are not rendered by default.

crates/sherpa-rs-sys/dist.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"tag": "v1.12.9",
2+
"tag": "v1.12.15",
33
"url": "https://github.com/k2-fsa/sherpa-onnx/releases/download/{tag}/{archive}",
44
"targets": {
55
"x86_64-pc-windows-msvc": {

crates/sherpa-rs-sys/sherpa-onnx

Submodule sherpa-onnx updated 601 files

crates/sherpa-rs-sys/src/download_binaries.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub struct Dist {
112112
impl DistTable {
113113
fn new(content: &str) -> Self {
114114
let mut table: DistTable = serde_json::from_str(content)
115-
.unwrap_or_else(|_| panic!("Failed to parse dist.json: {}", content));
115+
.unwrap_or_else(|_| panic!("Failed to parse dist.json: {content}"));
116116
table.url = table.url.replace("{tag}", &table.tag);
117117
for value in table.targets.values_mut() {
118118
// expand static with {tag}
@@ -145,7 +145,7 @@ impl DistTable {
145145
self.targets
146146
.get(target)
147147
.unwrap_or_else(||
148-
panic!("Target {} not found. try to disable download-feature with --no-default-features.", target)
148+
panic!("Target {target} not found. try to disable download-feature with --no-default-features.")
149149
)
150150
};
151151
debug_log!(
@@ -213,7 +213,7 @@ fn hex_str_to_bytes(c: impl AsRef<[u8]>) -> Vec<u8> {
213213
fn bytes_to_hex_str(bytes: Vec<u8>) -> String {
214214
let mut s = String::with_capacity(bytes.len() * 2);
215215
for byte in bytes {
216-
s.push_str(&format!("{:02x}", byte));
216+
s.push_str(&format!("{byte:02x}"));
217217
}
218218
s
219219
}

crates/sherpa-rs/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sherpa-rs"
3-
version = "0.6.7"
3+
version = "0.6.8"
44
edition = "2021"
55
authors = ["thewh1teagle"]
66
license = "MIT"
@@ -21,7 +21,7 @@ crate-type = ["cdylib", "rlib"]
2121
[dependencies]
2222
eyre = "0.6.12"
2323
hound = { version = "3.5.1" }
24-
sherpa-rs-sys = { path = "../sherpa-rs-sys", version = "0.6.7", default-features = false }
24+
sherpa-rs-sys = { path = "../sherpa-rs-sys", version = "0.6.8", default-features = false }
2525
tracing = "0.1.40"
2626

2727
[dev-dependencies]
@@ -55,6 +55,11 @@ name = "tts_matcha"
5555
required-features = ["tts"]
5656
path = "../../examples/tts_matcha.rs"
5757

58+
[[example]]
59+
name = "tts_zipvoice"
60+
required-features = ["tts"]
61+
path = "../../examples/tts_zipvoice.rs"
62+
5863
[[example]]
5964
name = "audio_tag"
6065
path = "../../examples/audio_tag.rs"

crates/sherpa-rs/src/dolphin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ impl DolphinRecognizer {
6969
modeling_unit: mem::zeroed::<_>(),
7070
zipformer_ctc: mem::zeroed::<_>(),
7171
canary: mem::zeroed::<_>(),
72+
wenet_ctc: mem::zeroed::<_>(),
7273
}
7374
};
7475

0 commit comments

Comments
 (0)