Skip to content

Commit

Permalink
Fix top_p to allow setting it to 1.0 (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
magdyksaleh authored Nov 12, 2024
1 parent 8f2cbf7 commit 9082d36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions router/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,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)
Expand Down Expand Up @@ -884,7 +884,7 @@ mod tests {
GenerateRequest {
inputs: "Hello".to_string(),
parameters: GenerateParameters {
top_p: Some(1.0),
top_p: Some(1.1),
..default_parameters()
},
add_special_tokens: true,
Expand Down

0 comments on commit 9082d36

Please sign in to comment.