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,
return err
}
// Remove first leading space from prevConvo if present
if len(prevConvo) > 0 && prevConvo[0] == ' ' {
prevConvo = prevConvo[1:]
}
// Remove leading spaces from prevConvo if present
prevConvo = strings.TrimLeft(prevConvo, " ")
var nextContext strings.Builder
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