@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / c2e00af523
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 17, 03:00 UTC

[Bugfix] fix utils.py/merge_dict func TypeError: 'type' object is not subscriptable (#3955)

Co-authored-by: tianyi_zhao <tianyi.zhao@transwarp.io>

zhaotyer committed Apr 10, 2024 at 12:49 UTC c2e00af523b0638dcca68c9a42a9187449841ced
1 file changed +3 -3
vllm/utils.py
+3 -3
@@ -9,7 +9,7 @@ import warnings
9 from collections import OrderedDict, defaultdict
10 from functools import lru_cache, partial
11 from platform import uname
12 -from typing import (Any, Awaitable, Callable, Generic, Hashable, List,
12 +from typing import (Any, Awaitable, Callable, Dict, Generic, Hashable, List,
13 Optional, Tuple, TypeVar, Union)
14
15 import psutil
@@ -452,8 +452,8 @@ def maybe_expand_dim(tensor: torch.Tensor,
452 return tensor
453
454
455 -def merge_dicts(dict1: dict[Any, list[Any]],
456 - dict2: dict[Any, list[Any]]) -> dict[Any, list[Any]]:
455 +def merge_dicts(dict1: Dict[Any, List[Any]],
456 + dict2: Dict[Any, List[Any]]) -> Dict[Any, List[Any]]:
457 """Merge 2 dicts that have key -> List of items.
458
459 When a key conflicts, the values in dict1 is prioritized.