Skip to content

Commit 667c14c

Browse files
committed
Cancel job properly in async wrapper
1 parent 93d652a commit 667c14c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

exllamav2/generator/dynamic_async.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ async def close(self):
4848
except asyncio.CancelledError:
4949
pass
5050

51+
async def cancel(self, job: ExLlamaV2DynamicJobAsync):
52+
assert job.job in self.jobs
53+
self.generator.cancel(job.job)
54+
del self.jobs[job.job]
55+
5156

5257
class ExLlamaV2DynamicJobAsync:
5358
"""
@@ -75,4 +80,4 @@ async def __aiter__(self):
7580
break
7681

7782
async def cancel(self):
78-
self.generator.generator.cancel(self.job)
83+
await self.generator.cancel(self)

0 commit comments

Comments
 (0)