From 23d16f285898756b385eafb75e25d8fbfe6196ed Mon Sep 17 00:00:00 2001 From: jiahua Date: Tue, 30 Apr 2024 09:34:38 +0800 Subject: [PATCH] fix: let context stateless, remove whisper_full_get_segment_speaker_turn_next from context, better to use the same fn in state --- src/whisper_ctx.rs | 14 -------------- src/whisper_ctx_wrapper.rs | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/src/whisper_ctx.rs b/src/whisper_ctx.rs index 910a2c4..1520f7a 100644 --- a/src/whisper_ctx.rs +++ b/src/whisper_ctx.rs @@ -499,20 +499,6 @@ impl WhisperInnerContext { pub fn token_transcribe(&self) -> WhisperToken { unsafe { whisper_rs_sys::whisper_token_transcribe(self.ctx) } } - - /// Get whether the next segment is predicted as a speaker turn - /// - /// # Arguments - /// * i_segment: Segment index. - /// - /// # Returns - /// bool - /// - /// # C++ equivalent - /// `bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment)` - pub fn full_get_segment_speaker_turn_next(&mut self, i_segment: c_int) -> bool { - unsafe { whisper_rs_sys::whisper_full_get_segment_speaker_turn_next(self.ctx, i_segment) } - } } impl Drop for WhisperInnerContext { diff --git a/src/whisper_ctx_wrapper.rs b/src/whisper_ctx_wrapper.rs index 4e5fa8c..04ecfcb 100644 --- a/src/whisper_ctx_wrapper.rs +++ b/src/whisper_ctx_wrapper.rs @@ -438,20 +438,6 @@ impl WhisperContext { self.ctx.token_transcribe() } - /// Get whether the next segment is predicted as a speaker turn - /// - /// # Arguments - /// * i_segment: Segment index. - /// - /// # Returns - /// bool - /// - /// # C++ equivalent - /// `bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment)` - pub fn full_get_segment_speaker_turn_next(&mut self, i_segment: c_int) -> bool { - self.ctx.full_get_segment_speaker_turn_next(i_segment) - } - // we don't implement `whisper_init()` here since i have zero clue what `whisper_model_loader` does /// Create a new state object, ready for use.