Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.9 kB
4
Indexable
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Input In [1], in <cell line: 96>()
     94 num_classes = 93
     95 model_name = 'bert-base-uncased'
---> 96 tokenizer = BertTokenizer.from_pretrained(model_name)
     97 model = BertForSequenceClassification.from_pretrained(model_name, num_labels=num_classes)
    100 def tokenize_data(data):

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:1838, in PreTrainedTokenizerBase.from_pretrained(cls, pretrained_model_name_or_path, cache_dir, force_download, local_files_only, token, revision, *init_inputs, **kwargs)
   1832     logger.info(
   1833         f"Can't load following files from cache: {unresolved_files} and cannot check if these "
   1834         "files are necessary for the tokenizer to operate."
   1835     )
   1837 if all(full_file_name is None for full_file_name in resolved_vocab_files.values()):
-> 1838     raise EnvironmentError(
   1839         f"Can't load tokenizer for '{pretrained_model_name_or_path}'. If you were trying to load it from "
   1840         "'https://huggingface.co/models', make sure you don't have a local directory with the same name. "
   1841         f"Otherwise, make sure '{pretrained_model_name_or_path}' is the correct path to a directory "
   1842         f"containing all relevant files for a {cls.__name__} tokenizer."
   1843     )
   1845 for file_id, file_path in vocab_files.items():
   1846     if file_id not in resolved_vocab_files:

OSError: Can't load tokenizer for 'bert-base-uncased'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'bert-base-uncased' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer