THUDM / GLM

GLM (General Language Model)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

luo-li-ba-suo opened this issue · 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上

额 貌似是别的问题
这个问题不管好像没事