You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran data_reader.py and it occurred an error as following,
Using backend: pytorch
Traceback (most recent call last):
File "data_reader.py", line 2, in
dataset_reader = data_reader.CNNDMDatasetReader()
File "/home/carol/DiscoBERT/model/data_reader.py", line 114, in init
self._token_indexers = token_indexers['bert'] or {"tokens": SingleIdTokenIndexer()}
TypeError: 'PretrainedBertIndexer' object is not subscriptable
And I found that there wasn't a key named 'bert' in token_indexers, that's why the problem occurred. I wonder If the bert model has been correctly obtained by the following code. token_indexers: Dict[str, TokenIndexer] = PretrainedBertIndexer("bert-base-uncased")
Environment
allennlp == 0.9.0
python == 3.6.12
torch == 1.5.0
I ran data_reader.py and it occurred an error as following,
And I found that there wasn't a key named 'bert' in token_indexers, that's why the problem occurred. I wonder If the bert model has been correctly obtained by the following code.
token_indexers: Dict[str, TokenIndexer] = PretrainedBertIndexer("bert-base-uncased")
And here is the content in token_indexers,
The text was updated successfully, but these errors were encountered: