File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change 39
39
"top_p" : 0.8
40
40
},
41
41
"o3" : {
42
- "temperature" : 0.7 ,
43
- "top_p" : 0.8
42
+ "temperature" : 1.0
44
43
},
45
44
"o4-mini" : {
46
45
"temperature" : 0.7 ,
69
68
"top_p" : 0.8
70
69
},
71
70
"openai/o3" : {
72
- "temperature" : 0.7 ,
73
- "top_p" : 0.8
71
+ "temperature" : 1.0
74
72
},
75
73
"openai/o4-mini" : {
76
74
"temperature" : 0.7 ,
168
166
}
169
167
}
170
168
}
171
- }
169
+ }
170
+
Original file line number Diff line number Diff line change @@ -456,9 +456,11 @@ async def chat_completions_stream(request: ChatCompletionRequest):
456
456
model_kwargs = {
457
457
"model" : request .model ,
458
458
"stream" : True ,
459
- "temperature" : model_config ["temperature" ],
460
- "top_p" : model_config ["top_p" ]
459
+ "temperature" : model_config ["temperature" ]
461
460
}
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" ]
462
464
463
465
api_kwargs = model .convert_inputs_to_api_kwargs (
464
466
input = prompt ,
@@ -478,9 +480,11 @@ async def chat_completions_stream(request: ChatCompletionRequest):
478
480
model_kwargs = {
479
481
"model" : request .model ,
480
482
"stream" : True ,
481
- "temperature" : model_config ["temperature" ],
482
- "top_p" : model_config ["top_p" ]
483
+ "temperature" : model_config ["temperature" ]
483
484
}
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" ]
484
488
485
489
api_kwargs = model .convert_inputs_to_api_kwargs (
486
490
input = prompt ,
Original file line number Diff line number Diff line change @@ -458,9 +458,11 @@ async def handle_websocket_chat(websocket: WebSocket):
458
458
model_kwargs = {
459
459
"model" : request .model ,
460
460
"stream" : True ,
461
- "temperature" : model_config ["temperature" ],
462
- "top_p" : model_config ["top_p" ]
461
+ "temperature" : model_config ["temperature" ]
463
462
}
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" ]
464
466
465
467
api_kwargs = model .convert_inputs_to_api_kwargs (
466
468
input = prompt ,
@@ -480,9 +482,11 @@ async def handle_websocket_chat(websocket: WebSocket):
480
482
model_kwargs = {
481
483
"model" : request .model ,
482
484
"stream" : True ,
483
- "temperature" : model_config ["temperature" ],
484
- "top_p" : model_config ["top_p" ]
485
+ "temperature" : model_config ["temperature" ]
485
486
}
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" ]
486
490
487
491
api_kwargs = model .convert_inputs_to_api_kwargs (
488
492
input = prompt ,
You can’t perform that action at this time.
0 commit comments