Skip to content

Commit

Permalink
Merge pull request #181 from arizhih/whisper-cpp-1-7-x
Browse files Browse the repository at this point in the history
Update whisper.cpp version to 1.7.1
  • Loading branch information
tazz4843 authored Oct 24, 2024
2 parents cfec70d + cc92f1b commit 82679b0
Show file tree
Hide file tree
Showing 9 changed files with 468 additions and 327 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust-version: [stable, nightly]
os: [ ubuntu-latest, windows-latest, macos-latest ]
rust-version: [ stable, nightly ]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code into the proper directory
Expand All @@ -55,8 +55,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust-version: [stable, nightly]
os: [ ubuntu-latest, windows-latest, macos-latest ]
rust-version: [ stable, nightly ]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code into the proper directory
Expand All @@ -72,5 +72,9 @@ jobs:
with:
toolchain: ${{ matrix.rust-version }}

- name: Install OpenMP
run: brew install libomp
if: contains(matrix.os, 'macos')

- name: Check build
run: cargo build --verbose
run: cargo build -F whisper-cpp-log,whisper-cpp-tracing --verbose --examples
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["examples/full_usage"]

[package]
name = "whisper-rs"
version = "0.13.0"
version = "0.13.1"
edition = "2021"
description = "Rust bindings for whisper.cpp"
license = "Unlicense"
Expand All @@ -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

[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 }
tracing = { version = "0.1", optional = true }

Expand Down
4 changes: 0 additions & 4 deletions src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ pub unsafe fn set_log_callback(
) {
unsafe {
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);
}
}
}

Expand Down
7 changes: 0 additions & 7 deletions src/whisper_sys_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,5 @@ unsafe extern "C" fn whisper_cpp_log_trampoline(
pub fn install_whisper_log_trampoline() {
crate::LOG_TRAMPOLINE_INSTALL.call_once(|| unsafe {
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(),
);
}
});
}
7 changes: 0 additions & 7 deletions src/whisper_sys_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,5 @@ unsafe extern "C" fn whisper_cpp_tracing_trampoline(
pub fn install_whisper_tracing_trampoline() {
crate::LOG_TRAMPOLINE_INSTALL.call_once(|| unsafe {
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(),
);
}
});
}
2 changes: 1 addition & 1 deletion sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "whisper-rs-sys"
version = "0.11.0"
version = "0.11.1"
edition = "2021"
description = "Rust bindings for whisper.cpp (FFI bindings)"
license = "Unlicense"
Expand Down
6 changes: 4 additions & 2 deletions sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ fn main() {
{
if target.contains("gnu") {
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");
}
}

Expand Down Expand Up @@ -244,8 +247,7 @@ fn main() {

let destination = config.build();

add_link_search_path(&out.join("lib")).unwrap();
add_link_search_path(&out.join("build/src")).unwrap();
add_link_search_path(&out.join("build")).unwrap();

println!("cargo:rustc-link-search=native={}", destination.display());
println!("cargo:rustc-link-lib=static=whisper");
Expand Down
Loading

0 comments on commit 82679b0

Please sign in to comment.