Skip to content

Commit

Permalink
openai: dont populate logit_bias if None (#28482)
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis authored Dec 3, 2024
1 parent ff675c1 commit 7315360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/partners/openai/langchain_openai/llms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ def _default_params(self) -> Dict[str, Any]:
"frequency_penalty": self.frequency_penalty,
"presence_penalty": self.presence_penalty,
"n": self.n,
"logit_bias": self.logit_bias,
"seed": self.seed,
"logprobs": self.logprobs,
}

if self.logit_bias is not None:
normal_params["logit_bias"] = self.logit_bias

if self.max_tokens is not None:
normal_params["max_tokens"] = self.max_tokens

Expand Down

0 comments on commit 7315360

Please sign in to comment.