Skip to content

Commit 232e324

Browse files
authored
fix(autoparser): correctly pass by logprobs (#9239)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 39c9547 commit 232e324

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

core/http/endpoints/openai/chat.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,12 @@ func ChatEndpoint(cl *config.ModelConfigLoader, ml *model.ModelLoader, evaluator
10061006
if deltaReasoning != "" {
10071007
message.Reasoning = &deltaReasoning
10081008
}
1009-
result = []schema.Choice{{FinishReason: &stopReason, Index: 0, Message: message}}
1009+
newChoice := schema.Choice{FinishReason: &stopReason, Index: 0, Message: message}
1010+
// Preserve logprobs from the original result
1011+
if len(result) > 0 && result[0].Logprobs != nil {
1012+
newChoice.Logprobs = result[0].Logprobs
1013+
}
1014+
result = []schema.Choice{newChoice}
10101015
}
10111016
}
10121017

0 commit comments

Comments
 (0)