使用量化微调模型的时候报错
importlib.metadata.PackageNotFoundError: No package metadata was found for The ‘bitsandbytes>=0.37.0’ distribution was not found and is required by this application.
查询 bitsandbytes 是否存在:是版本问题还是根本没有安装?
python -c "import bitsandbytes; print(bitsandbytes.__version__)"
ok 发现是没有! 开始安装,建议是0.37.0 但是注意与CUDA的版本对应关系,我本地对应关系CUDA
nvidia-smi
去GitHUB上看支持CUDA>11的版本,继续安装
pip install bitsandbytes==0.39.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
或者
pip install bitsandbytes>=0.37.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
安装完成
如果有错 ====别急
验证:
python -c "import bitsandbytes; print(bitsandbytes.__version__)"
说明对CUDA支持的不好,重新安装最新版就OK!
卸载旧的
pip uninstall bitsandbytes
卸载完成
安装最新版本
pip install bitsandbytes -i https://pypi.tuna.tsinghua.edu.cn/simple
查看安装结果
pip show bitsandbytes
再次验证
python -c "import bitsandbytes; print(bitsandbytes.__version__)"
版本对应大功告成!