File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -887,6 +887,7 @@ async def oai_chat_completions(user_prompt,
887
887
base_path ,
888
888
async_client ,
889
889
debug = False ,
890
+ temperature = None ,
890
891
model = None ,
891
892
n_predict = None ,
892
893
enable_streaming = None ,
@@ -913,7 +914,8 @@ async def oai_chat_completions(user_prompt,
913
914
"model" : model ,
914
915
"max_tokens" : n_predict ,
915
916
"stream" : enable_streaming ,
916
- "seed" : seed
917
+ "temperature" : temperature if temperature is not None else 0.0 ,
918
+ "seed" : seed ,
917
919
}
918
920
if response_format is not None :
919
921
payload ['response_format' ] = response_format
@@ -978,7 +980,8 @@ async def oai_chat_completions(user_prompt,
978
980
max_tokens = n_predict ,
979
981
stream = enable_streaming ,
980
982
response_format = payload .get ('response_format' ),
981
- seed = seed
983
+ seed = seed ,
984
+ temperature = payload ['temperature' ]
982
985
)
983
986
except openai .error .AuthenticationError as e :
984
987
if expect_api_error is not None and expect_api_error :
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ static json oaicompat_completion_params_parse(
371
371
llama_params[" presence_penalty" ] = json_value (body, " presence_penalty" , 0.0 );
372
372
llama_params[" seed" ] = json_value (body, " seed" , LLAMA_DEFAULT_SEED);
373
373
llama_params[" stream" ] = json_value (body, " stream" , false );
374
- llama_params[" temperature" ] = json_value (body, " temperature" , 0 .0 );
374
+ llama_params[" temperature" ] = json_value (body, " temperature" , 1 .0 );
375
375
llama_params[" top_p" ] = json_value (body, " top_p" , 1.0 );
376
376
377
377
// Apply chat template to the list of messages
You can’t perform that action at this time.
0 commit comments