Skip to content

Commit

Permalink
[BUGFIX]: top_k is expected to be an integer. (#7227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atllkks10 authored Aug 7, 2024
1 parent 2385c8f commit 7b26109
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vllm/sampling_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ def _verify_args(self) -> None:
if self.top_k < -1 or self.top_k == 0:
raise ValueError(f"top_k must be -1 (disable), or at least 1, "
f"got {self.top_k}.")
if not isinstance(self.top_k, int):
raise TypeError(
f"top_k must be an integer, got {type(self.top_k).__name__}")
if not 0.0 <= self.min_p <= 1.0:
raise ValueError("min_p must be in [0, 1], got "
f"{self.min_p}.")
Expand Down

0 comments on commit 7b26109

Please sign in to comment.