cannot import name 'CPMAntTokenizer' from 'transformers'
BugApe opened this issue · 2 comments
BugApe commented
参照hugging face openbmb/cpm-ant-10b model card上的描述
from transformers import CPMAntTokenizer, CPMAntModel
texts = ["今天天气真好!"]
model = CPMAntModel.from_pretrained("openbmb/cpm-ant-10b")
tokenizer = CPMAntTokenizer.from_pretrained("openbmb/cpm-ant-10b")
input_ids = tokenizer.get_model_input(texts)
logits, hidden = model(**input_ids)
print(logits.shape)
print(hidden.shape)
得到如下错误
cannot import name 'CPMAntTokenizer' from 'transformers'
ImportError: cannot import name 'CPMAntModel' from 'transformers'
已经transformers更新至最新版本(4.24.0),请问是怎么回事呢
zh-zheng commented
Hi,
transformers上的CPM-Ant代码目前还在开发中。
BugApe commented
Hi, transformers上的CPM-Ant代码目前还在开发中。
好的,谢谢