mirror of
https://github.com/karpathy/minGPT
synced 2024-09-20 10:53:25 +02:00
fix a dumb bug, intended to use -1e10 instead of 1e-10. thank you @fpgaminer for spotting and bringing to my attention
This commit is contained in:
parent
0d9d098cd2
commit
d708b1e5e2
@ -13,7 +13,7 @@ def set_seed(seed):
|
||||
def top_k_logits(logits, k):
|
||||
v, ix = torch.topk(logits, k)
|
||||
out = logits.clone()
|
||||
out[out < v[:, [-1]]] = 1e-10
|
||||
out[out < v[:, [-1]]] = -float('Inf')
|
||||
return out
|
||||
|
||||
@torch.no_grad()
|
||||
|
Loading…
Reference in New Issue
Block a user