support control eos, fix #6345

Former-commit-id: cb0f8399356bf372f3b7963f2565c3d504be0923
This commit is contained in:
hiyouga
2024-12-17 10:42:05 +00:00
parent 6522467ddb
commit 19ebc0e7a2
5 changed files with 21 additions and 7 deletions

View File

@@ -170,7 +170,7 @@ class VllmEngine(BaseEngine):
stop=stop,
stop_token_ids=[self.tokenizer.eos_token_id] + self.tokenizer.additional_special_tokens_ids,
max_tokens=max_tokens,
skip_special_tokens=True,
skip_special_tokens=self.generating_args["skip_special_tokens"],
)
if images is not None: # add image features