From 543e9218d0dcb5abe6b964c6b751bc8fda64c1a2 Mon Sep 17 00:00:00 2001 From: tianyi_zhao Date: Wed, 10 Apr 2024 11:08:02 +0800 Subject: [PATCH 1/3] fix utils.py/merge_dict func TypeError: 'type' object is not subscriptable --- vllm/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vllm/utils.py b/vllm/utils.py index 380ffe76fea7..f637927f05a4 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -10,7 +10,7 @@ from functools import lru_cache, partial from platform import uname from typing import (Any, Awaitable, Callable, Generic, Hashable, List, - Optional, Tuple, TypeVar, Union) + Optional, Tuple, TypeVar, Dict) import psutil import torch @@ -452,8 +452,8 @@ def maybe_expand_dim(tensor: torch.Tensor, return tensor -def merge_dicts(dict1: dict[Any, list[Any]], - dict2: dict[Any, list[Any]]) -> dict[Any, list[Any]]: +def merge_dicts(dict1: Dict[Any, List[Any]], + dict2: Dict[Any, List[Any]]) -> Dict[Any, List[Any]]: """Merge 2 dicts that have key -> List of items. When a key conflicts, the values in dict1 is prioritized. From a34219b11529c50b63967d090337b46b7d8af0f8 Mon Sep 17 00:00:00 2001 From: tianyi_zhao Date: Wed, 10 Apr 2024 11:21:12 +0800 Subject: [PATCH 2/3] add Union --- vllm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/utils.py b/vllm/utils.py index f637927f05a4..bcb1d1ef374b 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -10,7 +10,7 @@ from functools import lru_cache, partial from platform import uname from typing import (Any, Awaitable, Callable, Generic, Hashable, List, - Optional, Tuple, TypeVar, Dict) + Optional, Tuple, TypeVar, Union, Dict) import psutil import torch From ce576f90c76f54b11e01d0e17f41541052fed2ec Mon Sep 17 00:00:00 2001 From: tianyi_zhao Date: Wed, 10 Apr 2024 11:55:45 +0800 Subject: [PATCH 3/3] sort this alphabetically --- vllm/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/utils.py b/vllm/utils.py index bcb1d1ef374b..8ba03333d3b6 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -9,8 +9,8 @@ from collections import OrderedDict, defaultdict from functools import lru_cache, partial from platform import uname -from typing import (Any, Awaitable, Callable, Generic, Hashable, List, - Optional, Tuple, TypeVar, Union, Dict) +from typing import (Any, Awaitable, Callable, Dict, Generic, Hashable, List, + Optional, Tuple, TypeVar, Union) import psutil import torch