运行大模型的时候报错说
RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback):
module ‘torch’ has no attribute ‘float8_e4m3fnuz’
这是因为我的torch版本只有2.1,太低导致的。升到2.3版本就能解决。、
这里还有个问题,直接升的话,可能cuda版本也变了,模型跑不起来。
可以在官方网站上,找到适配当前cuda的高等级torch。
对于opencompass评测来说,安装如下:
conda install pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=12.1 -c pytorch -c nvidia