Skip to content

Commit

Permalink
Typo bug in top p / k sampling (octoml#152)
Browse files Browse the repository at this point in the history
* Bug fix in top p/k sampling due to typo

* remove blank
  • Loading branch information
masahi authored and zxybazh committed Jan 10, 2024
1 parent 4c56eac commit e36aea4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions serve/mlc_serve/model/paged_cache_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ def _is_safe_to_sample(prob_like):
logits_random.div_(t.unsqueeze(dim=1))

if do_top_p or do_top_k:
# TODO(vvchernov): looks like there is misprinting. Should logits_random be returned?
# If no, where are logits used below?
logits = _apply_top_p_top_k(logits_random, top_ps, top_ks)
logits_random = _apply_top_p_top_k(logits_random, top_ps, top_ks)

probs = torch.softmax(logits_random, dim=-1)

Expand Down

0 comments on commit e36aea4

Please sign in to comment.