clear cache during prompt processing

This commit is contained in:
Awni Hannun 2024-10-09 14:04:42 -07:00
parent b7373cb44f
commit 1ac75759ee

View File

@ -242,6 +242,7 @@ def generate_step(
model(y[:prefill_step_size][None], cache=prompt_cache)
mx.eval([c.state for c in prompt_cache])
y = y[prefill_step_size:]
mx.metal.clear_cache()
y, logprobs = _step(y)