lvyufeng / Cybertron

mindspore implementation of transformers
Apache License 2.0
65 stars 10 forks source link

你好,我运行了readme中快速入门的代码,但是最后一行outputs = model(inputs)报这个错请问是什么原因呢? #1

Closed carabnuu closed 2 years ago

carabnuu commented 2 years ago

你好, 我运行了该段代码, `from bert4ms import BertModel,BertTokenizer

tokenizer = BertTokenizer.load('bert-base-uncased') model = BertModel.load('bert-base-uncased', force_download=False) model.set_train(True)

inputs = tokenizer("hello world")

outputs = model(inputs)`

但是最后一行代码,即将inputs传入model,报以下错误:

TypeError: mindspore\ccsrc\pipeline\jit\pipeline.cc:235 CheckArgsValid] The inputs types of the outermost network support bool, int, float, None, tensor, mstype.Number(mstype.bool, mstype.int, mstype.float, mstype.uint), and tuple or list containing only these types, and dict whose values are these types, but the 0th arg type is <class 'list'>, value is '['hello', 'world']'.

这是什么原因呢?

lvyufeng commented 2 years ago

tokenizer当时还没做好,昨天已更新