Skip to content

Commit

Permalink
Changing back this logprobs default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Sep 24, 2024
1 parent a52d2e4 commit 0671e51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions router/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
2 changes: 1 addition & 1 deletion router/src/vertex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0671e51

Please sign in to comment.