Closed XUJiahua closed 2 months ago
Hmm looking at CI's failure it might be hard to work around without introducing some sort of internal lock (which should be avoided here I think) or removing the function entirely from WhisperState and moving it to WhisperContext.
Hmm looking at CI's failure it might be hard to work around without introducing some sort of internal lock (which should be avoided here I think) or removing the function entirely from WhisperState and moving it to WhisperContext.
I just remove whisper_full_get_segment_speaker_turn_next from context and ci passed. I think it's ok to let user use full_get_segment_speaker_turn_next in state, the result is the same. https://github.com/ggerganov/whisper.cpp/blob/master/whisper.cpp#L6248
Looking at that link you sent uh it appears that function never worked: ctx->state
is a nullptr with how whisper-rs initalizes whisper. Anyways this PR looks good thanks :)
Looked through CI and saw warnings, easy to fix here and may as well do so.
All deprecated functions were removed.
I encountered difficulties using the state correctly in callbacks due to challenges with the borrow checker. I adopted the approach suggested by @jcsoo in this discussion: https://github.com/tazz4843/whisper-rs/issues/86#issuecomment-2058049340.
Here's a summary of the refactoring changes:
I'd appreciate your feedback on this approach :)