Where is the file located relative to your model folder? I believe it has to be a relative PATH rather than an absolute one. So if your file where you are writing the code is located in 'my/local/'
, then your code should be like so:
PATH = 'models/cased_L-12_H-768_A-12/'
tokenizer = BertTokenizer.from_pretrained(PATH, local_files_only=True)
You just need to specify the folder where all the files are, and not the files directly. I think this is definitely a problem with the PATH
. Try changing the style of “slashes”: “/” vs “\”, these are different in different operating systems. Also try using “.”, like so ./models/cased_L-12_H-768_A-12/
etc.