Skip to content

Commit cb2539c

Browse files
committedMar 10, 2024
openai: add presence_penalty parameter
Signed-off-by: blob42 <contact@blob42.xyz>
1 parent 05b03b8 commit cb2539c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎core/http/endpoints/openai/request.go

+4
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ func updateRequestConfig(config *config.BackendConfig, input *schema.OpenAIReque
189189
config.FrequencyPenalty = input.FrequencyPenalty
190190
}
191191

192+
if input.PresencePenalty!= 0 {
193+
config.PresencePenalty = input.PresencePenalty
194+
}
195+
192196
if input.Keep != 0 {
193197
config.Keep = input.Keep
194198
}

‎core/schema/prediction.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type PredictionOptions struct {
3030
Mirostat int `json:"mirostat" yaml:"mirostat"`
3131

3232
FrequencyPenalty float64 `json:"frequency_penalty" yaml:"frequency_penalty"`
33+
PresencePenalty float64 `json:"presence_penalty" yaml:"presence_penalty"`
3334
TFZ float64 `json:"tfz" yaml:"tfz"`
3435

3536
TypicalP float64 `json:"typical_p" yaml:"typical_p"`

0 commit comments

Comments
 (0)