mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 01:17:28 +08:00
clear cache during prompt processing (#1027)
This commit is contained in:
parent
b7373cb44f
commit
4360e7ccec
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user