From b321f2988b36c098c7ebc02e40ad56a65fec2c81 Mon Sep 17 00:00:00 2001 From: Ravi N Date: Sun, 28 Jul 2024 21:55:53 -0400 Subject: [PATCH] Allow zero temperature for Sagemaker models based on config Since Sagemaker can host any kind of model, some models allow zero temperature. However, this is not enabled by default and only allowed based on config --- litellm/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 7c22953bc2..46bedb2748 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3114,7 +3114,8 @@ def get_optional_params( if temperature == 0.0 or temperature == 0: # hugging face exception raised when temp==0 # Failed: Error occurred: HuggingfaceException - Input validation error: `temperature` must be strictly positive - temperature = 0.01 + if not passed_params.get("aws_sagemaker_allow_zero_temp", False): + temperature = 0.01 optional_params["temperature"] = temperature if top_p is not None: optional_params["top_p"] = top_p