gpt4 book ai didi

python - 无法从 'T5Tokenizer' 导入名称 'transformers.models.t5'

转载 作者:行者123 更新时间:2023-12-04 17:19:38 28 4
gpt4 key购买 nike

正如您在以下 python 控制台中看到的,我可以导入 T5Tokenizer来自 transformers .但是,对于 simpletransformers.t5我收到一个错误:

>>> from transformers import T5Model, T5Tokenizer
>>> from simpletransformers.t5 import T5Model, T5Args
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pouramini/miniconda3/lib/python3.7/site-packages/simpletransformers/t5/__init$
_.py", line 2, in <module>
from simpletransformers.t5.t5_model import T5Model
File "/home/pouramini/miniconda3/lib/python3.7/site-packages/simpletransformers/t5/t5_mod$
l.py", line 20, in <module>
from transformers.models.t5 import T5Config, T5ForConditionalGeneration, T5Tokenizer
ImportError: cannot import name 'T5Tokenizer' from 'transformers.models.t5' (unknown locatio
n)

最佳答案

只需尝试安装旧版本的变压器:

!pip install transformers[torch]==4.3

关于python - 无法从 'T5Tokenizer' 导入名称 'transformers.models.t5',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66998668/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com