Skip to content

Commit f8a7263

Browse files
authored
Merge pull request #1092 from dpmm99/fix-interactive-eos
InteractiveExecutor now stops at EOS tokens again
2 parents 937ed23 + b5070b8 commit f8a7263

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

LLama/LLamaInteractExecutor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ private Task PreprocessLlava(string text, InferStateArgs args, bool addBos = tru
213213
return (true, Array.Empty<string>());
214214
}
215215

216-
if (_embeds.Count > 0 && _embeds.Last() == Context.Vocab.EOS)
216+
if (_embeds.Count > 0 && _embeds.Last().IsEndOfGeneration(Context.Vocab))
217217
{
218-
return (true, new[] { " [end of text]\n" });
218+
return (true, Array.Empty<string>());
219219
}
220220

221221
if (args.RemainedTokens <= 0 && inferenceParams.MaxTokens != -1)

0 commit comments

Comments
 (0)