JJoeven

Exercises / transformers

KV cache append

A cache is a list. prefill(xs) replaces it. decode(x) appends x and returns the new length. Print lengths after prefill of 3 and one decode.

Live Pythonpython
Output
Run to execute this in your browser. Nothing is sent to a server.