allow specifying stop conditions in modelfile

This commit is contained in:
Bruce MacDonald
2023-07-27 17:02:14 -04:00
parent 822a0e36eb
commit 184ad8f057
3 changed files with 11 additions and 2 deletions

View File

@@ -246,7 +246,7 @@ func (llm *LLM) Predict(ctx []int, prompt string, fn func(api.GenerateResponse))
}
func (llm *LLM) checkStopConditions(b bytes.Buffer) error {
for _, stopCondition := range llm.StopConditions {
for _, stopCondition := range llm.Stop {
if stopCondition == b.String() {
return io.EOF
} else if strings.HasPrefix(stopCondition, b.String()) {