summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-03-07 20:16:37 -0800
committeryum <yum.food.vr@gmail.com>2023-03-07 20:22:56 -0800
commit5e30b2366a4a320f59ed7e0bfcfe72f5f8c9d108 (patch)
tree38cb3a51eca3329386d07e32d62de83057e4bcb7
parenta74ee78dbb79c551851dc182090e7d4292b1e80c (diff)
Fix beam search previous window conditioning
Not all contexts had `prev_prompt`, causing most beams to misbehave.
-rw-r--r--Whisper/Whisper/ContextImpl.cpp5
-rw-r--r--Whisper/WhisperCLI/WhisperCLI.vcxproj2
2 files changed, 7 insertions, 0 deletions
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 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
+ <LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);$(OutDir)Whisper.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>