mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-08 04:05:20 +00:00
parent
931a5f3cb9
commit
5eb712f962
@ -250,9 +250,9 @@ func (llm *LLM) Predict(ctx []int, prompt string, fn func(api.GenerateResponse))
|
|||||||
|
|
||||||
func (llm *LLM) checkStopConditions(b bytes.Buffer) error {
|
func (llm *LLM) checkStopConditions(b bytes.Buffer) error {
|
||||||
for _, stopCondition := range llm.Stop {
|
for _, stopCondition := range llm.Stop {
|
||||||
if stopCondition == b.String() {
|
if stopCondition == strings.TrimSpace(b.String()) {
|
||||||
return io.EOF
|
return io.EOF
|
||||||
} else if strings.HasPrefix(stopCondition, b.String()) {
|
} else if strings.HasPrefix(stopCondition, strings.TrimSpace(b.String())) {
|
||||||
return errNeedMoreData
|
return errNeedMoreData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user