From 0b226ac027476ca5497886a9476bf09ad70f57c9 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 2 May 2023 16:02:45 -0400 Subject: [PATCH] Stop parameter of OpenAIRequest changed to String Array (#153) --- api/openai.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/openai.go b/api/openai.go index 50aa503..9547cf6 100644 --- a/api/openai.go +++ b/api/openai.go @@ -63,7 +63,7 @@ type OpenAIRequest struct { Instruction string `json:"instruction" yaml:"instruction"` Input string `json:"input" yaml:"input"` - Stop string `json:"stop" yaml:"stop"` + Stop []string `json:"stop" yaml:"stop"` // Messages is read only by chat/completion API calls Messages []Message `json:"messages" yaml:"messages"` @@ -117,8 +117,8 @@ func updateConfig(config *Config, input *OpenAIRequest) { config.Maxtokens = input.Maxtokens } - if input.Stop != "" { - config.StopWords = append(config.StopWords, input.Stop) + if len(input.Stop) != 0 { + config.StopWords = append(config.StopWords, input.Stop...) } if input.RepeatPenalty != 0 {