Support o1 model on Azure (#4980)

Co-authored-by: Shan Yu <shanyu1@g.ucla.edu>
This commit is contained in:
Chuyue Sun
2025-04-21 00:46:09 -07:00
committed by GitHub
parent 3b6d539f63
commit 08289eaa3e

View File

@@ -161,7 +161,11 @@ class OpenAI(BaseBackend):
prompt = s.text_
kwargs = sampling_params.to_openai_kwargs()
if self.model_name.startswith("o1") or self.model_name.startswith("o3"):
if (
self.model_name.startswith("o1")
or self.model_name.startswith("o3")
or "o1" in self.model_name
):
kwargs.pop("max_tokens", None)
else:
kwargs.pop("max_completion_tokens", None)