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
16 changes: 5 additions & 11 deletions vllm/sampling_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,29 +338,23 @@ def __post_init__(self) -> None:

if self.seed == -1:
self.seed = None
else:
self.seed = self.seed

if self.stop is None:
self.stop = []
elif isinstance(self.stop, str):
self.stop = [self.stop]
else:
self.stop = list(self.stop)

if self.stop_token_ids is None:
self.stop_token_ids = []
else:
self.stop_token_ids = list(self.stop_token_ids)

if self.bad_words is None:
self.bad_words = []
else:
self.bad_words = list(self.bad_words)

self.logprobs = 1 if self.logprobs is True else self.logprobs
self.prompt_logprobs = (1 if self.prompt_logprobs is True else
self.prompt_logprobs)
if self.logprobs is True:
self.logprobs = 1

if self.prompt_logprobs is True:
self.prompt_logprobs = 1

# Number of characters to hold back for stop string evaluation
# until sequence is finished.
Expand Down