use strings.TrimLeft to remove spaces
This commit is contained in:
parent
90c49bed57
commit
46b9953f32
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue