From 5b2730743850f1927a2bcfb4c7f1cae306a18e80 Mon Sep 17 00:00:00 2001 From: Michael Conrad <5229492+michael-conrad@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:22:23 -0400 Subject: [PATCH] Don't error on OpenAI valid `top_p` values. Don't error on OpenAI `top_p` valid values. * Closes: https://github.com/guidance-ai/guidance/issues/945 * Closes: https://github.com/huggingface/text-generation-inference/issues/2222 --- router/src/validation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/src/validation.rs b/router/src/validation.rs index 07ad14c9..0d3903ab 100644 --- a/router/src/validation.rs +++ b/router/src/validation.rs @@ -247,7 +247,7 @@ impl Validation { // for the user let top_p = top_p .map(|value| { - if value <= 0.0 || value >= 1.0 { + if value < 0.0 || value > 1.0 { return Err(ValidationError::TopP); } Ok(value)