VisualGLM-6B icon indicating copy to clipboard operation
VisualGLM-6B copied to clipboard

调用微调模型报错

Open 2499048212 opened this issue 2 years ago • 3 comments

使用finetune微调了模型,运行cli_demo加载微调后的模型时报错ValueError: Missing keys for inference ['transformer.position_embeddings.weight'].If you still want to inference anyway, pass --force_inference to args. 请问该怎么处理。 报错

2499048212 avatar Sep 15 '23 07:09 2499048212

说明你微调的时候没用最新版的sat代码,但是部署的时候又使用了新版sat环境。请保持训练和部署环境一致。

建议使用新版sat代码,权重格式已经发生变化(需要重新下载),两者不兼容,如果混用会发生推理错误。

1049451037 avatar Sep 15 '23 08:09 1049451037

如果我忽略这个问题,继续在SwissArmyTransformer==0.4.0的环境中使用模型,模型的能力会受到影响吗

2499048212 avatar Sep 15 '23 08:09 2499048212

如果你训练的时候用的是0.4.0,并且训练的时候验证过inference没问题,那就没影响。

1049451037 avatar Sep 15 '23 08:09 1049451037