Commit 46b9953f authored by Arne Müller's avatar Arne Müller
Browse files

use strings.TrimLeft to remove spaces

parent 90c49bed
...@@ -464,10 +464,8 @@ func (llm *llama) Predict(ctx context.Context, prevContext []int, prompt string, ...@@ -464,10 +464,8 @@ func (llm *llama) Predict(ctx context.Context, prevContext []int, prompt string,
return err return err
} }
// Remove first leading space from prevConvo if present // Remove leading spaces from prevConvo if present
if len(prevConvo) > 0 && prevConvo[0] == ' ' { prevConvo = strings.TrimLeft(prevConvo, " ")
prevConvo = prevConvo[1:]
}
var nextContext strings.Builder var nextContext strings.Builder
nextContext.WriteString(prevConvo) nextContext.WriteString(prevConvo)
......
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