Skip to content

Commit 4fc0faf

Browse files
ChuyueSunshanyu-sys
authored andcommitted
Support o1 model on Azure (sgl-project#4980)
Co-authored-by: Shan Yu <[email protected]>
1 parent 58e03f3 commit 4fc0faf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/sglang/lang/backend/openai.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ def generate(
161161
prompt = s.text_
162162

163163
kwargs = sampling_params.to_openai_kwargs()
164-
if self.model_name.startswith("o1") or self.model_name.startswith("o3"):
164+
if (
165+
self.model_name.startswith("o1")
166+
or self.model_name.startswith("o3")
167+
or "o1" in self.model_name
168+
):
165169
kwargs.pop("max_tokens", None)
166170
else:
167171
kwargs.pop("max_completion_tokens", None)

0 commit comments

Comments
 (0)