ToB企服应用市场:ToB评测及商务社交产业平台

标题: [Bug] Error: cannot import name ‘ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST [打印本页]

作者: 一给    时间: 2024-6-14 21:31
标题: [Bug] Error: cannot import name ‘ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST
code

  1. BRANCH = 'r1.23.0'
  2. !python -m pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[all]
复制代码
  1. # Ignore pre-production warnings
  2. import warnings
  3. warnings.filterwarnings('ignore')
  4. import nemo
  5. # Import Speech Recognition collection
  6. import nemo.collections.asr as nemo_asr
  7. # Import Natural Language Processing collection
  8. import nemo.collections.nlp as nemo_nlp
  9. # Import Speech Synthesis collection
  10. import nemo.collections.tts as nemo_tts
  11. # We'll use this to listen to audio
  12. import IPython
复制代码

出现下面的错误

  
  1. ---------------------------------------------------------------------------
复制代码
  1. ImportError                               Traceback (most recent call last)
复制代码
  1. <ipython-input-16-57327be21084> in <cell line: 8>()
  2.       6 import nemo.collections.asr as nemo_asr
  3.       7 # Import Natural Language Processing collection
  4. ----> 8 import nemo.collections.nlp as nemo_nlp
  5.       9 # Import Speech Synthesis collection
  6.      10 import nemo.collections.tts as nemo_tts
  7. ImportError: cannot import name 'ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/__init__.py)
复制代码
/usr/local/lib/python3.10/dist-packages/nemo/collections/nlp/modules/common/huggingface/huggingface_utils.py in <module> 16 from typing import List, Optional 17 ---> 18 from transformers import ( 19 ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, 20 BERT_PRETRAINED_MODEL_ARCHIVE_LIST,  
分析和办理

import nemo.collections.nlp as nemo_nlp
这一步有问题,但是根本原因还是 transformers 版本有点问题,找到对应的版本即可。
以是重新安装一下下面版本的transformers
!pip uninstall transformers
!pip install transformers==4.36.0

好了顺利办理。


 



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4