mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-29 11:45:16 +08:00
put prompt processing in same stream
This commit is contained in:
parent
adaab81029
commit
3586c876aa
@ -274,6 +274,7 @@ def generate_step(
|
||||
y = sampler(logprobs)
|
||||
return y, logprobs.squeeze(0)
|
||||
|
||||
with mx.stream(generation_stream):
|
||||
while y.size > prefill_step_size:
|
||||
model(y[:prefill_step_size][None], cache=prompt_cache)
|
||||
mx.eval([c.state for c in prompt_cache])
|
||||
|
Loading…
Reference in New Issue
Block a user