"Using beam search as a sampling parameter is deprecated, and will be removed in the future release. Please use the `vllm.LLM.use_beam_search` method for dedicated beam search instead, or set the environment variable `VLLM_ALLOW_DEPRECATED_BEAM_SEARCH=1` to suppress this error. For more details, see https://github.com/vllm-project/vllm/issues/8306 ."# noqa
self.top_p=1.0
)
self.top_k=-1
self._verify_beam_search()
self.min_p=0.0
else:
self._verify_greedy_sampling()
self._verify_non_beam_search()
ifself.temperature<_SAMPLING_EPS:
# Zero temperature means greedy sampling.
self.top_p=1.0
self.top_k=-1
self.min_p=0.0
self._verify_greedy_sampling()
# eos_token_id is added to this by the engine
# eos_token_id is added to this by the engine
self._all_stop_token_ids=set(self.stop_token_ids)
self._all_stop_token_ids=set(self.stop_token_ids)
...
@@ -417,31 +389,6 @@ class SamplingParams(
...
@@ -417,31 +389,6 @@ class SamplingParams(
RequestOutputKind.DELTA):
RequestOutputKind.DELTA):
raiseValueError("best_of must equal n to use output_kind=DELTA")
raiseValueError("best_of must equal n to use output_kind=DELTA")
def_verify_beam_search(self)->None:
ifself.best_of==1:
raiseValueError("best_of must be greater than 1 when using beam "
f"search. Got {self.best_of}.")
ifself.temperature>_SAMPLING_EPS:
raiseValueError("temperature must be 0 when using beam search.")
ifself.top_p<1.0-_SAMPLING_EPS:
raiseValueError("top_p must be 1 when using beam search.")
ifself.top_k!=-1:
raiseValueError("top_k must be -1 when using beam search.")
ifself.early_stoppingnotin[True,False,"never"]:
raiseValueError(
f"early_stopping must be True, False, or 'never', "
f"got {self.early_stopping}.")
def_verify_non_beam_search(self)->None:
ifself.early_stoppingisnotFalse:
raiseValueError("early_stopping is not effective and must be "
"False when not using beam search.")
if(self.length_penalty<1.0-_SAMPLING_EPS
orself.length_penalty>1.0+_SAMPLING_EPS):
raiseValueError(
"length_penalty is not effective and must be the "
"default value of 1.0 when not using beam search.")