微信公众号:leetcode_algos_life,代码随想随记
小红书:412408155
CSDN:https://blog.csdn.net/woai8339?type=blog ,代码随想随记
GitHub: https://github.com/riverind
抖音【暂未开始,计划开始】:tian72530,代码随想随记
知乎【暂未开始,计划开始】:happy001
问题
今天用TRL做大模型训练,出现如下错误:
ImportError: cannot import name 'SFTTrainer' from 'trl'
和
ImportError: cannot import name 'prepare_model_for_kbit_training' from 'peft'
解决方案
采用git源码安装而不是pip install
安装。
pip install -U git+https://github.com/huggingface/trl
和
pip install git+https://github.com/huggingface/peft