Unverified Commit da915345 authored by Yaroslav's avatar Yaroslav Committed by GitHub
Browse files

openai: don't scale temperature or frequency_penalty (#6514)

parent 8a027bc4
...@@ -513,7 +513,7 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) { ...@@ -513,7 +513,7 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) {
} }
if r.Temperature != nil { if r.Temperature != nil {
options["temperature"] = *r.Temperature * 2.0 options["temperature"] = *r.Temperature
} else { } else {
options["temperature"] = 1.0 options["temperature"] = 1.0
} }
...@@ -522,9 +522,9 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) { ...@@ -522,9 +522,9 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) {
options["seed"] = *r.Seed options["seed"] = *r.Seed
} }
options["frequency_penalty"] = r.FrequencyPenalty * 2.0 options["frequency_penalty"] = r.FrequencyPenalty
options["presence_penalty"] = r.PresencePenalty * 2.0 options["presence_penalty"] = r.PresencePenalty
if r.TopP != 0.0 { if r.TopP != 0.0 {
options["top_p"] = r.TopP options["top_p"] = r.TopP
......
...@@ -275,7 +275,7 @@ func TestCompletionsMiddleware(t *testing.T) { ...@@ -275,7 +275,7 @@ func TestCompletionsMiddleware(t *testing.T) {
Options: map[string]any{ Options: map[string]any{
"frequency_penalty": 0.0, "frequency_penalty": 0.0,
"presence_penalty": 0.0, "presence_penalty": 0.0,
"temperature": 1.6, "temperature": 0.8,
"top_p": 1.0, "top_p": 1.0,
"stop": []any{"\n", "stop"}, "stop": []any{"\n", "stop"},
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment