Commit 807ace5b authored by Gabe Goodhart's avatar Gabe Goodhart Committed by Jesse Gross
Browse files

fix(runner): Set logits to 0 if false on Batch.Add

https://github.com/ollama/ollama/issues/7656


Branch: Granite3StoppingBug-7656
Signed-off-by: default avatarGabe Goodhart <ghart@us.ibm.com>
parent 4b8a2e34
...@@ -384,6 +384,8 @@ func (b *Batch) Add(token int, embed []float32, pos int, logits bool, seqIds ... ...@@ -384,6 +384,8 @@ func (b *Batch) Add(token int, embed []float32, pos int, logits bool, seqIds ...
if logits { if logits {
unsafe.Slice(b.c.logits, b.allocSize())[b.c.n_tokens] = 1 unsafe.Slice(b.c.logits, b.allocSize())[b.c.n_tokens] = 1
} else {
unsafe.Slice(b.c.logits, b.allocSize())[b.c.n_tokens] = 0
} }
b.c.n_tokens += 1 b.c.n_tokens += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment