airsyuan
airsyuan
Dear developers: Another question is when I run tapas/experiments/tapas_classifier_experiment.py(MATE) raising an error: _get_projection_length' is not defined. I try to import the function, however, it can not be searched from other...
> 如果你用的是[zero_nlp](https://github.com/yuanzhoulvpi2017/zero_nlp)/[simple_thu_chatglm6b](https://github.com/yuanzhoulvpi2017/zero_nlp/tree/main/simple_thu_chatglm6b)/infer.ipynb,原因大概有3点 > > 1. LoraConfig 里`inference_mode=False` ,即使后面执行了 `model.eval()` 新加的那些 lora 参数依然会算梯度。正常情况下推理模式的模型所有的参数应该都不需要算梯度。解决办法就是设置`inference_mode=True`或者手动设置一遍 > > ``` > for n, p in model.named_parameters(): > p.requires_grad = False > ``` > > 2....