Skip to content

Commit

Permalink
[Misc] Suppress duplicated logging regarding multimodal input pipeline (
Browse files Browse the repository at this point in the history
vllm-project#10530)

Signed-off-by: Roger Wang <[email protected]>
Signed-off-by: Maxime Fournioux <[email protected]>
  • Loading branch information
ywang96 authored and mfournioux committed Nov 28, 2024
1 parent a682208 commit fee1e44
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/inputs/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from vllm.multimodal.processing import MultiModalDataDict, MultiModalInputsV2
from vllm.prompt_adapter.request import PromptAdapterRequest
from vllm.transformers_utils.tokenizer_group import BaseTokenizerGroup
from vllm.utils import print_warning_once
from vllm.utils import print_info_once, print_warning_once

from .data import (DecoderOnlyInputs, EncoderDecoderInputs, ProcessorInputs,
PromptType, SingletonInputs, SingletonPrompt, token_inputs)
Expand Down Expand Up @@ -212,7 +212,7 @@ def _can_process_multimodal(self) -> bool:
# updated to use the new multi-modal processor
can_process_multimodal = self.mm_registry.has_processor(model_config)
if not can_process_multimodal:
logger.info(
print_info_once(
"Your model uses the legacy input pipeline instead of the new "
"multi-modal processor. Please note that the legacy pipeline "
"will be removed in a future release. For more details, see: "
Expand Down
6 changes: 6 additions & 0 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,12 @@ def create_kv_caches_with_random(
return key_caches, value_caches


@lru_cache
def print_info_once(msg: str) -> None:
# Set the stacklevel to 2 to print the caller's line info
logger.info(msg, stacklevel=2)


@lru_cache
def print_warning_once(msg: str) -> None:
# Set the stacklevel to 2 to print the caller's line info
Expand Down

0 comments on commit fee1e44

Please sign in to comment.