Skip to content

Commit 95cfa72

Browse files
committed
top_k sampler: Fix int check for older Pythons
1 parent 1e17547 commit 95cfa72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exllamav3/generator/sampler/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class SS_TopK(SS_Base):
219219
Mask out all but the top K most likely tokens
220220
"""
221221
def __init__(self, top_k: int):
222-
assert top_k.is_integer(), "top_k value must be integer"
222+
assert isinstance(top_k, int) or top_k.is_integer(), "top_k value must be integer"
223223
self.top_k = int(top_k)
224224

225225
def run(self, state: SamplingState):

0 commit comments

Comments
 (0)