[Misc] Add deprecation warning for beam search (#6402)

This commit is contained in:
Woosuk Kwon
2024-07-13 11:52:22 -07:00
committed by GitHub
parent babf52dade
commit eeceadaecc
2 changed files with 17 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ import torch
from pydantic import Field
from typing_extensions import Annotated
import vllm.envs as envs
from vllm.logger import init_logger
logger = init_logger(__name__)
_SAMPLING_EPS = 1e-5
@@ -184,6 +189,13 @@ class SamplingParams:
self._verify_args()
if self.use_beam_search:
if not envs.VLLM_NO_DEPRECATION_WARNING:
logger.warning(
"[IMPORTANT] We plan to discontinue the support for beam "
"search in the next major release. Please refer to "
"https://github.com/vllm-project/vllm/issues/6226 for "
"more information. Set VLLM_NO_DEPRECATION_WARNING=1 to "
"suppress this warning.")
self._verify_beam_search()
else:
self._verify_non_beam_search()