mirror of
https://github.com/mudler/LocalAI.git
synced 2024-06-07 19:40:48 +00:00
Stop parameter of OpenAIRequest changed to String Array (#153)
This commit is contained in:
parent
220d6fd59b
commit
0b226ac027
@ -63,7 +63,7 @@ type OpenAIRequest struct {
|
|||||||
Instruction string `json:"instruction" yaml:"instruction"`
|
Instruction string `json:"instruction" yaml:"instruction"`
|
||||||
Input string `json:"input" yaml:"input"`
|
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 is read only by chat/completion API calls
|
||||||
Messages []Message `json:"messages" yaml:"messages"`
|
Messages []Message `json:"messages" yaml:"messages"`
|
||||||
@ -117,8 +117,8 @@ func updateConfig(config *Config, input *OpenAIRequest) {
|
|||||||
config.Maxtokens = input.Maxtokens
|
config.Maxtokens = input.Maxtokens
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.Stop != "" {
|
if len(input.Stop) != 0 {
|
||||||
config.StopWords = append(config.StopWords, input.Stop)
|
config.StopWords = append(config.StopWords, input.Stop...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.RepeatPenalty != 0 {
|
if input.RepeatPenalty != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user