[Bugfix] Fix asyncio.Task not being subscriptable (#4623)

This commit is contained in:
Cyrus Leung
2024-05-07 00:31:05 +08:00
committed by GitHub
parent 0650e5935b
commit 323f27b904
2 changed files with 5 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
import asyncio
import time
from functools import partial
from typing import (Any, AsyncIterator, Callable, Dict, Iterable, List,
Optional, Set, Tuple, Type, Union)
from typing import (AsyncIterator, Callable, Dict, Iterable, List, Optional,
Set, Tuple, Type, Union)
from transformers import PreTrainedTokenizer
@@ -327,7 +327,7 @@ class AsyncLLMEngine:
# We need to keep a reference to unshielded
# task as well to prevent it from being garbage
# collected
self._background_loop_unshielded: Optional[asyncio.Task[Any]] = None
self._background_loop_unshielded: Optional[asyncio.Task] = None
self.start_engine_loop = start_engine_loop
self._errored_with: Optional[BaseException] = None