我已经使用 pip 安装了 trl。
!pip show trl
并且正确显示包裹信息,
!pip show trl
Name: trl
Version: 0.7.10
Summary: Train transformer language models with reinforcement learning.
Home-page: https://github.com/huggingface/trl
Author: Leandro von Werra
Author-email: [email protected]
License: Apache 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: accelerate, datasets, numpy, torch, transformers, tyro
Required-by:
但是,当我在笔记本中导入时,它显示错误:
import trl
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[9], line 1
----> 1 import trl
ModuleNotFoundError: No module named 'trl'
为什么会出现这种差异?怎么解决?
当我使用直接源安装时,问题得到解决,
pip install git+https://github.com/huggingface/trl.git