mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 04:32:50 +08:00
fix internlm2 template
Former-commit-id: a9c18255aa039550ca65145b930576edeb905d53
This commit is contained in:
parent
0be7b16955
commit
cb8abce2f3
@ -37,9 +37,9 @@ class ChatModel:
|
||||
tools: Optional[str] = None,
|
||||
**input_kwargs,
|
||||
) -> Tuple[Dict[str, Any], int]:
|
||||
messages += [{"role": "assistant", "content": ""}]
|
||||
new_messages = messages + [{"role": "assistant", "content": ""}]
|
||||
prompt, _ = self.template.encode_oneturn(
|
||||
tokenizer=self.tokenizer, messages=messages, system=system, tools=tools
|
||||
tokenizer=self.tokenizer, messages=new_messages, system=system, tools=tools
|
||||
)
|
||||
prompt_length = len(prompt)
|
||||
input_ids = torch.tensor([prompt], device=self.model.device)
|
||||
|
@ -416,7 +416,7 @@ register_template(
|
||||
"by the user such as English and 中文."
|
||||
),
|
||||
stop_words=["<|im_end|>"],
|
||||
replace_eos=True,
|
||||
efficient_eos=True,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user