GLM icon indicating copy to clipboard operation
GLM copied to clipboard

调用glm模型,遇到modeling_glm.py的bug:attention_mask初始化device设置遗漏

Open luo-li-ba-suo opened this issue 1 year ago • 1 comments

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper_CUDA__index_select)

原因是GLMModel类中 if attention_mask is None: attention_mask = torch.zeros(batch_size) 这里没有把attention_mask转到正确的device上

luo-li-ba-suo avatar Jul 13 '23 04:07 luo-li-ba-suo