Skip to content

Commit ea5f9d3

Browse files
committed
fix: always add bos when inference.
1 parent 1fca06d commit ea5f9d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LLama/LLamaModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public IEnumerable<string> Call(string text)
317317
{
318318
int n_left = _n_past - _params.n_keep;
319319

320-
_n_past = _params.n_keep;
320+
_n_past = Math.Max(1, _params.n_keep);
321321

322322
// insert n_left/2 tokens at the start of embed from last_n_tokens
323323
_embed.InsertRange(0, _last_n_tokens.GetRange(_n_ctx - n_left / 2 - _embed.Count, _embed.Count));

0 commit comments

Comments
 (0)