fix internlm xcomposer2 fp16 (#11123)

This commit is contained in:
Yishuo Wang 2024-05-24 11:03:31 +08:00 committed by GitHub
parent 011b9faa5c
commit 9372ce87ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -481,7 +481,7 @@ def internlm_xcomposser2_chat(
inputs, im_mask = self.interleav_wrap_chat(tokenizer, query, image,
history, meta_instruction)
inputs = {
k: v.to(self.device)
k: v.to(device=self.device, dtype=self.dtype)
for k, v in inputs.items() if torch.is_tensor(v)
}
im_mask = im_mask.to(self.device)