File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,6 @@ async def generate_with_context(
6868 formatted_messages = [{"role" : "system" , "content" : system_message }]
6969 formatted_messages .extend (messages )
7070
71- kwargs .setdefault ("temperature" , self .temperature )
7271 # define params
7372 params : Dict [str , Any ] = {
7473 "model" : self .model ,
@@ -101,10 +100,12 @@ async def generate_with_context(
101100 get_model = str (self .model ).lower ()
102101 if self .api_base == "https://api.openai.com/v1" and get_model in _O_SERIES_MODELS :
103102 # if user sets up temperature in config, will have a warning
104- if " temperature" in kwargs :
103+ if self . temperature is not None :
105104 logger .warning (
106105 f"Model { self .model !r} doesn't support temperature"
107106 )
107+ kwargs .pop ("temperature" , None )
108+ kwargs .pop ("top_p" , None )
108109
109110 else :
110111 params ["temperature" ] = kwargs .get ("temperature" , self .temperature )
You can’t perform that action at this time.
0 commit comments