Update vllm_engine.py

This commit is contained in:
hoshi-hiyouga 2024-05-20 00:31:04 +08:00 committed by GitHub
parent a943a1034b
commit a0e8d3d159
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -96,6 +96,7 @@ class VllmEngine(BaseEngine):
messages[0]["content"] = "<image>" * self.image_feature_size + messages[0]["content"] messages[0]["content"] = "<image>" * self.image_feature_size + messages[0]["content"]
paired_messages = messages + [{"role": "assistant", "content": ""}] paired_messages = messages + [{"role": "assistant", "content": ""}]
system = system or self.generating_args["default_system"]
prompt_ids, _ = self.template.encode_oneturn( prompt_ids, _ = self.template.encode_oneturn(
tokenizer=self.tokenizer, messages=paired_messages, system=system, tools=tools tokenizer=self.tokenizer, messages=paired_messages, system=system, tools=tools
) )