fix: remove blocking cleanup from streaming generator

- stream finally froze main thread on cache.task_free
- scheduler handles cleanup in next loop iteration instead
This commit is contained in:
2026-08-08 13:12:40 +08:00
parent ae9fd546ef
commit 0b661bae85
-4
View File
@@ -204,7 +204,6 @@ class InferenceEngine:
def gen():
nonlocal remaining
try:
while remaining > 0:
items = result.pop_all()
for idx, token in items:
@@ -216,9 +215,6 @@ class InferenceEngine:
yield (idx, token) if is_batch else token
if remaining > 0:
result.wait(timeout=0.05)
finally:
for tid in task_ids:
self.scheduler.remove_task(tid)
return gen()