当前位置:   article > 正文

【Linux】之——xshell使用huggingface流程_linux 访问huggingface

linux 访问huggingface

1.创建虚拟环境

conda create -n Distil3.7 python=3.7
  • 1

2.进入虚拟环境

source activate  Distil3.7
  • 1

3.下载transformers

conda install -c huggingface transformers
  • 1

4.下载pytorch

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
  • 1

5.验证是否安装成功

python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))"
  • 1
5.1 出现报错在这里插入图片描述解决:
pip install -U transformers
pip install -U huggingface_hub
pip install "sagemaker>=2.69.0" "transformers==4.12.3"
  • 1
  • 2
  • 3

6.安装成功结果显示

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/627614
推荐阅读
相关标签
  

闽ICP备14008679号