mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 22:20:43 +00:00
experimental: just force it to be a string array in all cases since OpenAI expects either a string or string array.
This commit is contained in:
parent
271d3f6673
commit
80a7205d2d
1 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,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"`
|
||||||
|
@ -116,8 +116,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…
Add table
Add a link
Reference in a new issue