首页 > 解决方案 > 如何确保我在 jupyter notebook 中使用的 py env 使用的是我从 github 克隆的转换器版本/代码?

问题描述

我确实在我的 github 帐户中分叉了 transformers repo,然后我做了:

git clone --recursive https://github.com/myaccount/transformers.git
cd transformers/
conda create -n hf-dev-py380 python=3.8.0
conda activate hf-dev-py380
git checkout v4.9.2-release
pip install -e “.[dev]”
conda install -c conda-forge librosa
conda install libgcc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/miniconda3/lib/
transformers-cli env

conda install jupyter
nohup jupyter notebook --ip=0.0.0.0 --port=myport &

在我的 jupyter 笔记本中,我打印:

import transformers
print(transformers)
<module ‘transformers’ from ‘/mypath/miniconda3/lib/python3.7/site-packages/transformers/init.py’&gt;

如何确保我的 jupyter notebook 正在使用我在终端中克隆的转换器代码?

谢谢!

标签: pythonjupyter-notebookhuggingface-transformersvirtual-environment

解决方案


推荐阅读