Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/freetoken/engine/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def prepare(self, batch: Batch) -> BatchSamplingArgs:
# parameters for those rows instead of approximating argmax at low temperature.
ts = [1.0 if g else max(p.temperature, MIN_T) for p, g in zip(params, is_greedy)]
top_ks = [
p.top_k if not g and p.top_k >= 1 else self.vocab_size
min(p.top_k, self.vocab_size) if not g and p.top_k >= 1 else self.vocab_size
for p, g in zip(params, is_greedy)
]
top_ps = [
Expand Down
Loading