From 9e33419e43613568a657e370cc8da7cbfd28e4a6 Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Thu, 26 Sep 2024 19:18:26 -0400 Subject: [PATCH] [Bugfix] Fix print_warning_once's line info (#8867) Signed-off-by: Alvant --- vllm/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/utils.py b/vllm/utils.py index b73e3b9bbf68e..a0d2a7e50fc63 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -744,7 +744,8 @@ def create_kv_caches_with_random( @lru_cache def print_warning_once(msg: str) -> None: - logger.warning(msg) + # Set the stacklevel to 2 to print the caller's line info + logger.warning(msg, stacklevel=2) @lru_cache(maxsize=None)