Unverified Commit dd1a50a8 authored by Li, Jiang's avatar Li, Jiang Committed by GitHub
Browse files

[Bugfix][Minor] Make ignore_eos effective (#4468)

parent 715c2d85
...@@ -275,7 +275,8 @@ class SamplingParams: ...@@ -275,7 +275,8 @@ class SamplingParams:
self, generation_config: Dict[str, Any]) -> None: self, generation_config: Dict[str, Any]) -> None:
"""Update if there are non-default values from generation_config""" """Update if there are non-default values from generation_config"""
# Update eos_token_id for generation # Update eos_token_id for generation
if eos_ids := generation_config.get("eos_token_id"): if (not self.ignore_eos) and (eos_ids :=
generation_config.get("eos_token_id")):
# it can be either int or list of int # it can be either int or list of int
if isinstance(eos_ids, int): if isinstance(eos_ids, int):
eos_ids = [eos_ids] eos_ids = [eos_ids]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment