Skip to content

Commit 559742e

Browse files
authored
fix o3 generator config (#226)
1 parent 526a148 commit 559742e

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

api/config/generator.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"top_p": 0.8
4040
},
4141
"o3": {
42-
"temperature": 0.7,
43-
"top_p": 0.8
42+
"temperature": 1.0
4443
},
4544
"o4-mini": {
4645
"temperature": 0.7,
@@ -69,8 +68,7 @@
6968
"top_p": 0.8
7069
},
7170
"openai/o3": {
72-
"temperature": 0.7,
73-
"top_p": 0.8
71+
"temperature": 1.0
7472
},
7573
"openai/o4-mini": {
7674
"temperature": 0.7,
@@ -168,4 +166,5 @@
168166
}
169167
}
170168
}
171-
}
169+
}
170+

api/simple_chat.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,11 @@ async def chat_completions_stream(request: ChatCompletionRequest):
456456
model_kwargs = {
457457
"model": request.model,
458458
"stream": True,
459-
"temperature": model_config["temperature"],
460-
"top_p": model_config["top_p"]
459+
"temperature": model_config["temperature"]
461460
}
461+
# Only add top_p if it exists in the model config
462+
if "top_p" in model_config:
463+
model_kwargs["top_p"] = model_config["top_p"]
462464

463465
api_kwargs = model.convert_inputs_to_api_kwargs(
464466
input=prompt,
@@ -478,9 +480,11 @@ async def chat_completions_stream(request: ChatCompletionRequest):
478480
model_kwargs = {
479481
"model": request.model,
480482
"stream": True,
481-
"temperature": model_config["temperature"],
482-
"top_p": model_config["top_p"]
483+
"temperature": model_config["temperature"]
483484
}
485+
# Only add top_p if it exists in the model config
486+
if "top_p" in model_config:
487+
model_kwargs["top_p"] = model_config["top_p"]
484488

485489
api_kwargs = model.convert_inputs_to_api_kwargs(
486490
input=prompt,

api/websocket_wiki.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,11 @@ async def handle_websocket_chat(websocket: WebSocket):
458458
model_kwargs = {
459459
"model": request.model,
460460
"stream": True,
461-
"temperature": model_config["temperature"],
462-
"top_p": model_config["top_p"]
461+
"temperature": model_config["temperature"]
463462
}
463+
# Only add top_p if it exists in the model config
464+
if "top_p" in model_config:
465+
model_kwargs["top_p"] = model_config["top_p"]
464466

465467
api_kwargs = model.convert_inputs_to_api_kwargs(
466468
input=prompt,
@@ -480,9 +482,11 @@ async def handle_websocket_chat(websocket: WebSocket):
480482
model_kwargs = {
481483
"model": request.model,
482484
"stream": True,
483-
"temperature": model_config["temperature"],
484-
"top_p": model_config["top_p"]
485+
"temperature": model_config["temperature"]
485486
}
487+
# Only add top_p if it exists in the model config
488+
if "top_p" in model_config:
489+
model_kwargs["top_p"] = model_config["top_p"]
486490

487491
api_kwargs = model.convert_inputs_to_api_kwargs(
488492
input=prompt,

0 commit comments

Comments
 (0)