Skip to content

Commit 3c6af90

Browse files
authored
Merge pull request #434 from martindevans/stateless_eos_check
Added a check for EOS token in LLamaStatelessExecutor
2 parents 5b41c8e + f160fbd commit 3c6af90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

LLama/LLamaStatelessExecutor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public async IAsyncEnumerable<string> InferAsync(string prompt, IInferenceParams
106106
);
107107
}
108108

109+
// Check if this is the EOS token
110+
if (id == _weights.EndOfSentenceToken)
111+
break;
112+
109113
// Decode this token into text
110114
decoder.Add(id);
111115
var decoded = decoder.Read();

0 commit comments

Comments
 (0)