From 5e30b2366a4a320f59ed7e0bfcfe72f5f8c9d108 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 7 Mar 2023 20:16:37 -0800 Subject: Fix beam search previous window conditioning Not all contexts had `prev_prompt`, causing most beams to misbehave. --- Whisper/Whisper/ContextImpl.cpp | 5 +++++ Whisper/WhisperCLI/WhisperCLI.vcxproj | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Whisper/Whisper/ContextImpl.cpp b/Whisper/Whisper/ContextImpl.cpp index c52a167..2fe2484 100644 --- a/Whisper/Whisper/ContextImpl.cpp +++ b/Whisper/Whisper/ContextImpl.cpp @@ -926,6 +926,11 @@ HRESULT COMLIGHTCALL ContextImpl::runFullImpl( const sFullParams& params, const for( const auto& r : tokens_cur ) prompt_past.push_back( r.id ); + for (int i = 0; i < n_ctxt; i++) { + auto& cur_prompt_past = ctx_[best_beam].prompt_past; + cur_prompt_past = prompt_past; + } + // store the text from this iteration if( !tokens_cur.empty() ) { diff --git a/Whisper/WhisperCLI/WhisperCLI.vcxproj b/Whisper/WhisperCLI/WhisperCLI.vcxproj index 8295eee..b268b37 100644 --- a/Whisper/WhisperCLI/WhisperCLI.vcxproj +++ b/Whisper/WhisperCLI/WhisperCLI.vcxproj @@ -126,12 +126,14 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + stdcpp20 Console true true true + $(CoreLibraryDependencies);%(AdditionalDependencies);$(OutDir)Whisper.lib -- cgit v1.2.3