From 46707918a5298079bb3adc510e59e458c53082be Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Thu, 26 Sep 2024 16:49:07 -0400 Subject: [PATCH] [Bugfix] Fix print_warning_once's line info --- 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)