[BugFix] AttributeError: 'AsyncOmniDiffusion' object has no attribute 'abort' (#624)
Signed-off-by: ZeldaHuang <hzm414167@alibaba-inc.com>
This commit is contained in:
1 parent
4cc28275f9
commit
f9b8bfd7bb
2 files changed
+11
-2
No files matched your search
@@ -4,7 +4,7 @@
|
||||
import multiprocessing as mp
|
||||
import time
|
||||
import weakref
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Callable, Iterable
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
@@ -361,3 +361,8 @@ class DiffusionEngine:
|
||||
|
||||
def close(self) -> None:
|
||||
self._finalizer()
|
||||
|
||||
def abort(self, request_id: str | Iterable[str]) -> None:
|
||||
# TODO implement it
|
||||
logger.warning("DiffusionEngine abort is not implemented yet")
|
||||
pass
|
||||
@@ -10,7 +10,7 @@ enabling concurrent request handling and streaming generation.
|
||||
|
||||
import asyncio
|
||||
import uuid
|
||||
from collections.abc import AsyncGenerator
|
||||
from collections.abc import AsyncGenerator, Iterable
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from dataclasses import fields
|
||||
from typing import Any
|
||||
@@ -263,6 +263,10 @@ class AsyncOmniDiffusion:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def abort(self, request_id: str | Iterable[str]) -> None:
|
||||
"""Abort a request."""
|
||||
self.engine.abort(request_id)
|
||||
|
||||
@property
|
||||
def is_running(self) -> bool:
|
||||
"""Check if the engine is running."""
|
||||
|
||||
Reference in new issue
Block a user