mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-03-20 05:47:54 +08:00
[Typing] Fix Sequence type GenericAlias only available after Python 3.9. (#4092)
This commit is contained in:
parent
4695397dcf
commit
37e84a403d
@ -1,9 +1,10 @@
|
||||
"""A block manager that manages token blocks."""
|
||||
from abc import ABC, abstractmethod
|
||||
from collections.abc import Sequence as GenericSequence
|
||||
from itertools import count, takewhile
|
||||
from os.path import commonprefix
|
||||
from typing import Dict, List, Optional, Set
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Sequence as GenericSequence
|
||||
from typing import Set
|
||||
|
||||
from vllm.block import BlockTable, PhysicalTokenBlock
|
||||
from vllm.core.evictor import EvictionPolicy, Evictor, make_evictor
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
"""A block manager that manages token blocks."""
|
||||
from collections.abc import Sequence as GenericSequence
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Sequence as GenericSequence
|
||||
|
||||
from vllm.core.block.block_table import BlockTable
|
||||
from vllm.core.block.cpu_gpu_block_allocator import CpuGpuBlockAllocator
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import enum
|
||||
from abc import ABC, abstractmethod
|
||||
from collections.abc import Sequence as GenericSequence
|
||||
from typing import Dict, List
|
||||
from typing import Sequence as GenericSequence
|
||||
|
||||
from vllm.sequence import Sequence, SequenceGroup
|
||||
|
||||
|
||||
@ -6,11 +6,12 @@ import socket
|
||||
import subprocess
|
||||
import uuid
|
||||
import warnings
|
||||
from collections import OrderedDict, defaultdict
|
||||
from collections import defaultdict
|
||||
from functools import lru_cache, partial
|
||||
from platform import uname
|
||||
from typing import (Any, AsyncIterator, Awaitable, Callable, Dict, Generic,
|
||||
Hashable, List, Optional, Tuple, TypeVar, Union)
|
||||
Hashable, List, Optional, OrderedDict, Tuple, TypeVar,
|
||||
Union)
|
||||
|
||||
import psutil
|
||||
import torch
|
||||
@ -51,7 +52,7 @@ class Counter:
|
||||
class LRUCache(Generic[T]):
|
||||
|
||||
def __init__(self, capacity: int):
|
||||
self.cache = OrderedDict[Hashable, T]()
|
||||
self.cache: OrderedDict[Hashable, T] = OrderedDict()
|
||||
self.capacity = capacity
|
||||
|
||||
def __contains__(self, key: Hashable) -> bool:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user