Skip to content

Commit

Permalink
slice tensor on gpu side
Browse files Browse the repository at this point in the history
  • Loading branch information
Valery Chernov committed Jan 30, 2024
1 parent 37579fc commit f61e148
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serve/mlc_serve/model/model_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _is_safe_to_sample(prob_like):
torch.cuda.nvtx.range_pop()
return None

res_random = torch.multinomial(probs, 1, True).cpu().numpy()[:, 0]
res_random = torch.multinomial(probs, 1, True)[:, 0].cpu().numpy()

if logits_random.shape[0] == num_seq:
torch.cuda.nvtx.range_pop()
Expand Down

0 comments on commit f61e148

Please sign in to comment.