AttributeError: 模块转换器没有属性 TFGPTNeoForCausalLM

问题描述

我克隆了此存储库/文档 https://huggingface.co/EleutherAI/gpt-neo-125M

无论是在 google collab 上还是在本地运行,都会出现以下错误。我也用这个安装了变压器

pip install git+https://github.com/huggingface/transformers

并确保配置文件名为 config.json

      5 tokenizer = AutoTokenizer.from_pretrained("gpt-neo-125M/",from_tf=True)
----> 6 model = AutoModelForCausalLM.from_pretrained("gpt-neo-125M",from_tf=True)
      7 
      8 

3 frames
/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py in __getattr__(self,name)

AttributeError: module transformers has no attribute TFGPTNeoForCausalLM

完整代码:

from transformers import AutoTokenizer,AutoModelForCausalLM 

tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125M",from_tf=True)

model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-neo-125M",from_tf=True)

transformers-cli env 结果:

  • transformers 版本:4.10.0.dev0
  • 平台:Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.29
  • Python 版本:3.8.5
  • PyTorch 版本(GPU?):1.9.0+cpu(错误)
  • Tensorflow 版本(GPU?):2.5.0(错误)
  • Flax 版本(CPU?/GPU?/TPU?):未安装(不适用)
  • Jax 版本:未安装
  • JaxLib 版本:未安装
  • 在脚本中使用 GPU?:
  • 在脚本中使用分布式或并行设置?:

协作和本地都有 TensorFlow 2.5.0 版本

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)