I've downloaded bert pretrained model 'bert-base-cased. I'm unable to load the model with help of BertTokenizer. I'm trying for bert tokenizer. In the bert-pretrained-model folder I have config.json and pytorch_model.bin.
tokenizer = BertTokenizer.from_pretrained(r'C:\Downloads\bert-pretrained-model')
I'm facing error like
OSError Traceback (most recent call last)
<ipython-input-17-bd4c0051c48e> in <module>
----> 1 tokenizer = BertTokenizer.from_pretrained(r'\Downloads\bert-pretrained-model')
~\sentiment_analysis\lib\site-packages\transformers\tokenization_utils_base.py in from_pretrained(cls, pretrained_model_name_or_path, *init_inputs, **kwargs)
1775 f"- or '{pretrained_model_name_or_path}' is the correct path to a directory containing relevant tokenizer files\n\n"
1776 )
-> 1777 raise EnvironmentError(msg)
1778
1779 for file_id, file_path in vocab_files.items():
OSError: Can't load tokenizer for 'C:\Downloads\bert-pretrained-model'. Make sure that:
- 'C:\Downloads\bert-pretrained-model' is a correct model identifier listed on 'https://huggingface.co/models'
- or 'C:\Downloads\bert-pretrained-model' is the correct path to a directory containing relevant tokenizer files
When I'm trying load with BertModel, it's loading. But when i'm trying with BertTokenizer it's not loading.
vocab.json
. – cronoiktokenizer_config.json
. – cronoik