Prepare next-token-prediction data from a sequence of token ids: the inputs are all tokens but the last, and the targets are all tokens but the first, so the model reads token t and must predict token t+1.
Implement solve(ids).
Returns. Return a tuple (inputs, targets) of NumPy arrays, each one shorter than ids.
Example 1
Input:
solve([10, 11, 12, 13])
Output:
([10, 11, 12], [11, 12, 13])
Example 2
Input:
solve([7, 8])
Output:
([7], [8])
No results yet
Run your code to check it against the examples, or submit to run every test.