diff --git a/LLama/LLamaStatelessExecutor.cs b/LLama/LLamaStatelessExecutor.cs index 831aceb2..7922db2b 100644 --- a/LLama/LLamaStatelessExecutor.cs +++ b/LLama/LLamaStatelessExecutor.cs @@ -57,6 +57,9 @@ namespace LLama using var context = _weights.CreateContext(_params, _logger); Context = context; + // Reset the sampling pipeline (if there is one) + inferenceParams?.SamplingPipeline?.Reset(); + // Sanity check inference params inferenceParams ??= new InferenceParams(); if (inferenceParams.TokensKeep > Context.ContextSize)