MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / next_token

Function next_token

lit_gpt/generate/base.py:59–64  ·  view source on GitHub ↗
(
    model: GPT, input_pos: torch.Tensor, x: torch.Tensor, **kwargs: Any
)

Source from the content-addressed store, hash-verified

57
58
59def next_token(
60 model: GPT, input_pos: torch.Tensor, x: torch.Tensor, **kwargs: Any
61) -> torch.Tensor:
62 logits = model(x, input_pos)
63 next = sample(logits, **kwargs)
64 return next.to(dtype=x.dtype)
65
66
67@torch.inference_mode()

Callers 1

generateFunction · 0.85

Calls 1

sampleFunction · 0.85

Tested by

no test coverage detected