"vscode:/vscode.git/clone" did not exist on "2b47d4fa4a647cfa634f2c3b4bbc29e92e32ef72"
Unverified Commit 7b261092 authored by Atilla Akkuş's avatar Atilla Akkuş Committed by GitHub
Browse files

[BUGFIX]: top_k is expected to be an integer. (#7227)

parent 2385c8f3
...@@ -224,6 +224,9 @@ class SamplingParams: ...@@ -224,6 +224,9 @@ class SamplingParams:
if self.top_k < -1 or self.top_k == 0: if self.top_k < -1 or self.top_k == 0:
raise ValueError(f"top_k must be -1 (disable), or at least 1, " raise ValueError(f"top_k must be -1 (disable), or at least 1, "
f"got {self.top_k}.") 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: if not 0.0 <= self.min_p <= 1.0:
raise ValueError("min_p must be in [0, 1], got " raise ValueError("min_p must be in [0, 1], got "
f"{self.min_p}.") f"{self.min_p}.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment