Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ def query_server(
if is_reasoning_model:
assert "o1" in model or "o3" in model, "Only support o1 and o3 for now"
print(f"Using OpenAI reasoning model: {model} with reasoning effort {reasoning_effort}")
print(f"Using OpenAI reasoning model: {model} with reasoning effort {reasoning_effort}")
response = client.chat.completions.create(
model=model,
messages=[
Expand Down Expand Up @@ -410,6 +409,14 @@ def _query_llm(prompt: str | list[dict]):

if kwargs:
server_args.update(kwargs)
# Special handling for o-series models
if server_type == "openai":
model_name = server_args.get("model_name", "")
if re.search(r"o\d", model_name):
# Remove max_tokens param
server_args.pop("max_tokens", None)
# Set to use the reasoning branch
server_args["is_reasoning_model"] = True
if greedy_sample:
server_args["temperature"] = 0.0
server_args["top_p"] = 1.0
Expand Down