when running the follwoing given example:
from transformers import AlbertTokenizer, AlbertModel
import torch
tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
model = AlbertModel.from_pretrained('albert-base-v2')
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
it alerts "* TypeError: 'AlbertTokenizer' object is not callable"
examples link: https://huggingface.co/transformers/model_doc/albert.html#alberttokenizer
Model I am using (Bert, XLNet ...):
ALBERT
Language I am using the model on (English, Chinese ...):
English
The problem arises when using:
* TypeError: 'AlbertTokenizer' object is not callable
Should given a workable example of using ALBERT ?
transformers version: 2.3.0Hi there, you should upgrade your transformers library to v3. The version you have does not have callable tokenizers.
Alternatively, the docs for v2.3.0 are here. You can use the dropdown menu on the left (just under the hugging face) to change the version of the documentation you are using.
Thanks very much
Alternatively, I found using tokenizer.ecode is ok.
But, How to view the old doc details for this version?
https://huggingface.co/transformers/v2.3.0/model_doc/albert.html#
This link seems to be archived documentation. No examples provided here.
This is the documentation of the version 2.3.0. For better documentation, you should really consider upgrading your library :-)
Understand. Thanks very much.
Most helpful comment
Hi there, you should upgrade your transformers library to v3. The version you have does not have callable tokenizers.
Alternatively, the docs for v2.3.0 are here. You can use the dropdown menu on the left (just under the hugging face) to change the version of the documentation you are using.