Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vllm/inputs/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_tokenizer(self) -> AnyTokenizer:

def get_bos_token_id(self) -> Optional[int]:
if self.tokenizer is None:
logger.warning(
logger.warning_once(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While this change aligns with other parts of the file, logger.warning_once will unfortunately cause a runtime TypeError. The underlying implementation in vllm/logger.py uses @lru_cache on a function that takes the logger instance as its first argument. Since logger instances are not hashable, this will cause a crash when this warning is triggered.

This change, intended to reduce log spam, introduces a crash. The *_once logging functionality appears to be broken throughout the codebase and needs to be fixed centrally in vllm/logger.py.

To avoid introducing a crash, I recommend reverting this to logger.warning until the underlying issue with warning_once is resolved.

Suggested change
logger.warning_once(
logger.warning(

"Using None for BOS token id because tokenizer is not initialized"
)
return None
Expand All @@ -78,7 +78,7 @@ def get_bos_token_id(self) -> Optional[int]:

def get_eos_token_id(self) -> Optional[int]:
if self.tokenizer is None:
logger.warning(
logger.warning_once(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While this change aligns with other parts of the file, logger.warning_once will unfortunately cause a runtime TypeError. The underlying implementation in vllm/logger.py uses @lru_cache on a function that takes the logger instance as its first argument. Since logger instances are not hashable, this will cause a crash when this warning is triggered.

This change, intended to reduce log spam, introduces a crash. The *_once logging functionality appears to be broken throughout the codebase and needs to be fixed centrally in vllm/logger.py.

To avoid introducing a crash, I recommend reverting this to logger.warning until the underlying issue with warning_once is resolved.

Suggested change
logger.warning_once(
logger.warning(

"Using None for EOS token id because tokenizer is not initialized"
)
return None
Expand Down