Merge pull request #181 from arizhih/whisper-cpp-1-7-x
Update whisper.cpp version to 1.7.1
This commit is contained in:
commit
82679b0125
9 changed files with 500 additions and 359 deletions
14
.github/workflows/pr.yml
vendored
14
.github/workflows/pr.yml
vendored
|
|
@ -30,8 +30,8 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||||
rust-version: [stable, nightly]
|
rust-version: [ stable, nightly ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code into the proper directory
|
- name: Check out code into the proper directory
|
||||||
|
|
@ -55,8 +55,8 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||||
rust-version: [stable, nightly]
|
rust-version: [ stable, nightly ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code into the proper directory
|
- name: Check out code into the proper directory
|
||||||
|
|
@ -72,5 +72,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.rust-version }}
|
toolchain: ${{ matrix.rust-version }}
|
||||||
|
|
||||||
|
- name: Install OpenMP
|
||||||
|
run: brew install libomp
|
||||||
|
if: contains(matrix.os, 'macos')
|
||||||
|
|
||||||
- name: Check build
|
- name: Check build
|
||||||
run: cargo build --verbose
|
run: cargo build -F whisper-cpp-log,whisper-cpp-tracing --verbose --examples
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ exclude = ["examples/full_usage"]
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "whisper-rs"
|
name = "whisper-rs"
|
||||||
version = "0.13.0"
|
version = "0.13.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Rust bindings for whisper.cpp"
|
description = "Rust bindings for whisper.cpp"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
@ -14,7 +14,7 @@ repository = "https://github.com/tazz4843/whisper-rs"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
whisper-rs-sys = { path = "sys", version = "0.11.0" }
|
whisper-rs-sys = { path = "sys", version = "0.11.1" }
|
||||||
log = { version = "0.4", optional = true }
|
log = { version = "0.4", optional = true }
|
||||||
tracing = { version = "0.1", optional = true }
|
tracing = { version = "0.1", optional = true }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,6 @@ pub unsafe fn set_log_callback(
|
||||||
) {
|
) {
|
||||||
unsafe {
|
unsafe {
|
||||||
whisper_rs_sys::whisper_log_set(log_callback, user_data);
|
whisper_rs_sys::whisper_log_set(log_callback, user_data);
|
||||||
#[cfg(feature = "metal")]
|
|
||||||
{
|
|
||||||
whisper_rs_sys::ggml_backend_metal_log_set_callback(log_callback, user_data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,5 @@ unsafe extern "C" fn whisper_cpp_log_trampoline(
|
||||||
pub fn install_whisper_log_trampoline() {
|
pub fn install_whisper_log_trampoline() {
|
||||||
crate::LOG_TRAMPOLINE_INSTALL.call_once(|| unsafe {
|
crate::LOG_TRAMPOLINE_INSTALL.call_once(|| unsafe {
|
||||||
whisper_rs_sys::whisper_log_set(Some(whisper_cpp_log_trampoline), std::ptr::null_mut());
|
whisper_rs_sys::whisper_log_set(Some(whisper_cpp_log_trampoline), std::ptr::null_mut());
|
||||||
#[cfg(feature = "metal")]
|
|
||||||
{
|
|
||||||
whisper_rs_sys::ggml_backend_metal_log_set_callback(
|
|
||||||
Some(whisper_cpp_log_trampoline),
|
|
||||||
std::ptr::null_mut(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,5 @@ unsafe extern "C" fn whisper_cpp_tracing_trampoline(
|
||||||
pub fn install_whisper_tracing_trampoline() {
|
pub fn install_whisper_tracing_trampoline() {
|
||||||
crate::LOG_TRAMPOLINE_INSTALL.call_once(|| unsafe {
|
crate::LOG_TRAMPOLINE_INSTALL.call_once(|| unsafe {
|
||||||
whisper_rs_sys::whisper_log_set(Some(whisper_cpp_tracing_trampoline), std::ptr::null_mut());
|
whisper_rs_sys::whisper_log_set(Some(whisper_cpp_tracing_trampoline), std::ptr::null_mut());
|
||||||
#[cfg(feature = "metal")]
|
|
||||||
{
|
|
||||||
whisper_rs_sys::ggml_backend_metal_log_set_callback(
|
|
||||||
Some(whisper_cpp_tracing_trampoline),
|
|
||||||
std::ptr::null_mut(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "whisper-rs-sys"
|
name = "whisper-rs-sys"
|
||||||
version = "0.11.0"
|
version = "0.11.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Rust bindings for whisper.cpp (FFI bindings)"
|
description = "Rust bindings for whisper.cpp (FFI bindings)"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,9 @@ fn main() {
|
||||||
{
|
{
|
||||||
if target.contains("gnu") {
|
if target.contains("gnu") {
|
||||||
println!("cargo:rustc-link-lib=gomp");
|
println!("cargo:rustc-link-lib=gomp");
|
||||||
|
} else if target.contains("apple") {
|
||||||
|
println!("cargo:rustc-link-lib=omp");
|
||||||
|
println!("cargo:rustc-link-search=/opt/homebrew/opt/libomp/lib");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -244,8 +247,7 @@ fn main() {
|
||||||
|
|
||||||
let destination = config.build();
|
let destination = config.build();
|
||||||
|
|
||||||
add_link_search_path(&out.join("lib")).unwrap();
|
add_link_search_path(&out.join("build")).unwrap();
|
||||||
add_link_search_path(&out.join("build/src")).unwrap();
|
|
||||||
|
|
||||||
println!("cargo:rustc-link-search=native={}", destination.display());
|
println!("cargo:rustc-link-search=native={}", destination.display());
|
||||||
println!("cargo:rustc-link-lib=static=whisper");
|
println!("cargo:rustc-link-lib=static=whisper");
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1 +1 @@
|
||||||
Subproject commit 9e3c5345cd46ea718209db53464e426c3fe7a25e
|
Subproject commit ebca09a3d1033417b0c630bbbe607b0f185b1488
|
||||||
Loading…
Add table
Add a link
Reference in a new issue