From ef7d037d75ab12c7db751d7738cfc4a36c945fb9 Mon Sep 17 00:00:00 2001 From: Chris Raethke Date: Tue, 21 Nov 2023 18:30:08 +1000 Subject: [PATCH 1/2] Expose WhisperGrammar* from the lib --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index ed17306..70b6d46 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,7 @@ pub use standalone::*; pub use utilities::*; pub use whisper_ctx::WhisperContext; pub use whisper_ctx::WhisperContextParameters; +pub use whisper_grammar::{WhisperGrammarElement, WhisperGrammarElementType}; pub use whisper_params::{FullParams, SamplingStrategy}; pub use whisper_state::WhisperState; From a07e27ed421b24f36dc017e20e2e5359be569993 Mon Sep 17 00:00:00 2001 From: Chris Raethke Date: Tue, 21 Nov 2023 18:30:59 +1000 Subject: [PATCH 2/2] Update WhisperContextParameters to &mut to avoid borrow issues --- src/whisper_ctx.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/whisper_ctx.rs b/src/whisper_ctx.rs index eaa8302..330391e 100644 --- a/src/whisper_ctx.rs +++ b/src/whisper_ctx.rs @@ -551,7 +551,7 @@ impl WhisperContextParameters { pub fn new() -> Self { Self::default() } - pub fn use_gpu(mut self, use_gpu: bool) -> Self { + pub fn use_gpu(&mut self, use_gpu: bool) -> &mut Self { self.use_gpu = use_gpu; self }