diff --git a/LLama/LLamaStatelessExecutor.cs b/LLama/LLamaStatelessExecutor.cs index 77c9dbe4..e03fe7a1 100644 --- a/LLama/LLamaStatelessExecutor.cs +++ b/LLama/LLamaStatelessExecutor.cs @@ -106,6 +106,10 @@ namespace LLama ); } + // Check if this is the EOS token + if (id == _weights.EndOfSentenceToken) + break; + // Decode this token into text decoder.Add(id); var decoded = decoder.Read();