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 16, 07:00 UTC
[Misc] Add __setitem__ for LazyDict (#10469)
Signed-off-by: Yanyi Liu <wolfsonliu@163.com>
Yanyi Liu committed
Nov 20, 2024 at 12:44 UTC
9e05252b46a92a5d14e4e6fd02b75383c5cf243b
1 file changed
+3
vllm/utils.py
+3
@@ -1491,6 +1491,9 @@ class LazyDict(Mapping, Generic[T]):
1491
self._dict[key] = self._factory[key]()
1492
return self._dict[key]
1493
1494
+ def __setitem__(self, key: str, value: Callable[[], T]):
1495
+ self._factory[key] = value
1496
+
1497
def __iter__(self):
1498
return iter(self._factory)
1499