Changing back this logprobs default.

This commit is contained in:
Nicolas Patry 2024-09-24 17:21:07 +02:00
parent 6744df5873
commit d46d3c65ea
No known key found for this signature in database
GPG Key ID: 64AF4752B2967863
3 changed files with 4 additions and 2 deletions

View File

@ -782,7 +782,7 @@ pub(crate) struct ChatRequest {
/// output token returned in the content of message.
#[serde(default)]
#[schema(example = "false")]
pub logprobs: bool,
pub logprobs: Option<bool>,
/// An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with
/// an associated log probability. logprobs must be set to true if this parameter is used.

View File

@ -1123,6 +1123,8 @@ async fn chat_completions(
let (generate_request, using_tools): (GenerateRequest, bool) =
chat.try_into_generate(&infer)?;
let logprobs = logprobs.unwrap_or_default();
// static values that will be returned in all cases
let model_id = info.model_id.clone();
let system_fingerprint = format!("{}-{}", info.version, info.docker_label.unwrap_or("native"));

View File

@ -56,7 +56,7 @@ pub(crate) struct VertexParameters {
/// output token returned in the content of message.
#[serde(default)]
#[schema(example = "false")]
pub logprobs: bool,
pub logprobs: Option<bool>,
/// An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with
/// an associated log probability. logprobs must be set to true if this parameter is used.