3 ms·
There's probably a better API that wraps generate, but there's a bit more work than the logit mask. You have to go one token at a time, otherwise the masking b
by rckrd 3y ago
There's probably a better API that wraps generate, but there's a bit more work than the logit mask.
You have to go one token at a time, otherwise the masking becomes combinatoric rather than linear (two tokens at a time -- need to generate all two token pairs, etc.).
But otherwise, that's what the code does! https://github.com/r2d4/rellm/blob/main/rellm/rellm.py#L21 https://github.com/r2d4/rellm/blob/main/rellm/rellm.py#L21