fix internlm xcomposser meta-instruction typo (#11448)

This commit is contained in:
Yishuo Wang 2024-06-27 15:29:43 +08:00 committed by GitHub
parent f89ca23748
commit c6e5ad668d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,