fix internlm xcomposser meta-instruction typo (#11448)
This commit is contained in:
parent
f89ca23748
commit
c6e5ad668d
1 changed files with 6 additions and 3 deletions
|
|
@ -456,6 +456,7 @@ def internlm_xcomposser2_chat(
|
|||
'responses effectively based on the provided image.'),
|
||||
**kwargs,
|
||||
):
|
||||
# ipex-llm changes start: fix device and dtype conversion
|
||||
if image is None:
|
||||
inputs = self.build_inputs(tokenizer, query, history, meta_instruction)
|
||||
im_mask = torch.zeros(inputs['input_ids'].shape[:2]).bool()
|
||||
|
|
@ -468,6 +469,8 @@ def internlm_xcomposser2_chat(
|
|||
for k, v in inputs.items() if torch.is_tensor(v)
|
||||
}
|
||||
im_mask = im_mask.to(self.device)
|
||||
# ipex-llm changes end
|
||||
|
||||
# also add end-of-assistant token in eos token id to avoid unnecessary generation
|
||||
eos_token_id = [
|
||||
tokenizer.eos_token_id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue