fix: server crash when stop_token_ids contains null (#22175)
Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
This commit is contained in:
@@ -68,7 +68,8 @@ class SamplingParams:
|
||||
self.max_new_tokens = max_new_tokens
|
||||
self.stop_strs = stop
|
||||
if stop_token_ids:
|
||||
self.stop_token_ids = set(stop_token_ids)
|
||||
filtered = {int(t) for t in stop_token_ids if t is not None}
|
||||
self.stop_token_ids = filtered or None
|
||||
else:
|
||||
self.stop_token_ids = None
|
||||
self.stop_regex_strs = stop_regex
|
||||
|
||||
Reference in New Issue
Block a user