Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running latest whisper.cpp #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/whisper_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,17 @@ impl WhisperContext {
/// Make sure to call [WhisperContext::decode] first.
///
/// # Arguments
/// * needs_timestamp
///
/// # Returns
/// Ok(WhisperToken) on success, Err(WhisperError) on failure.
///
/// # C++ equivalent
/// `whisper_token whisper_sample_best(struct whisper_context * ctx, bool need_timestamp)`
pub fn sample_best(&mut self, needs_timestamp: bool) -> Result<WhisperToken, WhisperError> {
/// `whisper_token whisper_sample_best(struct whisper_context * ctx)`
pub fn sample_best(&mut self) -> Result<WhisperToken, WhisperError> {
if !self.decode_once {
return Err(WhisperError::DecodeNotComplete);
}
let ret = unsafe { whisper_rs_sys::whisper_sample_best(self.ctx, needs_timestamp) };
let ret = unsafe { whisper_rs_sys::whisper_sample_best(self.ctx) };
Ok(ret)
}

Expand Down
8 changes: 4 additions & 4 deletions src/whisper_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ impl<'a> FullParams<'a> {

match decode_strategy {
DecodeStrategy::Greedy { n_past } => {
fp.__bindgen_anon_1.greedy.n_past = n_past;
// fp.__bindgen_anon_1.greedy.n_past = n_past;
}
DecodeStrategy::BeamSearch {
n_past,
beam_width,
n_best,
} => {
fp.__bindgen_anon_1.beam_search.n_past = n_past;
fp.__bindgen_anon_1.beam_search.beam_width = beam_width;
fp.__bindgen_anon_1.beam_search.n_best = n_best;
// fp.__bindgen_anon_1.beam_search.n_past = n_past;
// fp.__bindgen_anon_1.beam_search.beam_width = beam_width;
// fp.__bindgen_anon_1.beam_search.n_best = n_best;
}
}

Expand Down
2 changes: 1 addition & 1 deletion sys/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern "C" {
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_sample_best(ctx: *mut whisper_context, need_timestamp: bool) -> whisper_token;
pub fn whisper_sample_best(ctx: *mut whisper_context) -> whisper_token;
}
extern "C" {
pub fn whisper_sample_timestamp(ctx: *mut whisper_context) -> whisper_token;
Expand Down
2 changes: 1 addition & 1 deletion sys/whisper.cpp
Submodule whisper.cpp updated 40 files
+8 −0 .gitignore
+76 −25 CMakeLists.txt
+31 −5 Makefile
+95 −55 README.md
+3 −0 bindings/CMakeLists.txt
+1 −0 bindings/javascript/.gitignore
+33 −0 bindings/javascript/CMakeLists.txt
+80 −0 bindings/javascript/emscripten.cpp
+1 −0 bindings/javascript/whisper.js
+54 −0 cmake/BuildTypes.cmake
+22 −0 cmake/GitVars.cmake
+14 −0 examples/CMakeLists.txt
+17 −0 examples/whisper.objc/README.md
+382 −0 examples/whisper.objc/whisper.objc.xcodeproj/project.pbxproj
+7 −0 examples/whisper.objc/whisper.objc.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+8 −0 examples/whisper.objc/whisper.objc.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+14 −0 examples/whisper.objc/whisper.objc/AppDelegate.h
+40 −0 examples/whisper.objc/whisper.objc/AppDelegate.m
+11 −0 examples/whisper.objc/whisper.objc/Assets.xcassets/AccentColor.colorset/Contents.json
+13 −0 examples/whisper.objc/whisper.objc/Assets.xcassets/AppIcon.appiconset/Contents.json
+6 −0 examples/whisper.objc/whisper.objc/Assets.xcassets/Contents.json
+25 −0 examples/whisper.objc/whisper.objc/Base.lproj/LaunchScreen.storyboard
+89 −0 examples/whisper.objc/whisper.objc/Base.lproj/Main.storyboard
+27 −0 examples/whisper.objc/whisper.objc/Info.plist
+15 −0 examples/whisper.objc/whisper.objc/SceneDelegate.h
+57 −0 examples/whisper.objc/whisper.objc/SceneDelegate.m
+41 −0 examples/whisper.objc/whisper.objc/ViewController.h
+240 −0 examples/whisper.objc/whisper.objc/ViewController.m
+18 −0 examples/whisper.objc/whisper.objc/main.m
+4 −0 examples/whisper.wasm/CMakeLists.txt
+43 −0 examples/whisper.wasm/README.md
+486 −0 examples/whisper.wasm/index-tmpl.html
+8 −0 extra/convert-all.sh
+374 −110 ggml.c
+165 −85 main.cpp
+2 −2 models/convert-pt-to-ggml.py
+15 −6 stream.cpp
+4 −0 tests/CMakeLists.txt
+191 −96 whisper.cpp
+36 −19 whisper.h