【发布时间】:2021-10-06 18:51:22
【问题描述】:
我克隆了这个存储库/文档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 环境结果:
-
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?):未安装 (NA)
- Jax 版本:未安装
- JaxLib 版本:未安装
- 在脚本中使用 GPU?:
- 在脚本中使用分布式或并行设置?:
collab 和本地都有 TensorFlow 2.5.0 版本
【问题讨论】:
标签: python pytorch huggingface-transformers gpt gpt-3