Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.3 kB
2
Indexable
Never
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/transformers/modeling_utils.py:655, in PreTrainedModel.from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
    654     if resolved_archive_file is None:
--> 655         raise EnvironmentError
    656 except EnvironmentError:

OSError: 

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
Input In [1], in <cell line: 97>()
     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):
    101     inputs = tokenizer(
    102         data['ticket_category'] + ' ' + data['ticket_type'] + ' ' +
    103         data['ticket_item'] + ' ' + data['ticket_summary'] + ' ' + data['ticket_desc'],
   (...)
    106         return_tensors="pt"
    107     )

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/transformers/modeling_utils.py:662, in PreTrainedModel.from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
    656 except EnvironmentError:
    657     msg = (
    658         f"Can't load weights for '{pretrained_model_name_or_path}'. Make sure that:\n\n"
    659         f"- '{pretrained_model_name_or_path}' is a correct model identifier listed on 'https://huggingface.co/models'\n\n"
    660         f"- or '{pretrained_model_name_or_path}' is the correct path to a directory containing a file named one of {WEIGHTS_NAME}, {TF2_WEIGHTS_NAME}, {TF_WEIGHTS_NAME}.\n\n"
    661     )
--> 662     raise EnvironmentError(msg)
    664 if resolved_archive_file == archive_file:
    665     logger.info("loading weights file {}".format(archive_file))

OSError: Can't load weights for 'bert-base-uncased'. Make sure that:

- 'bert-base-uncased' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'bert-base-uncased' is the correct path to a directory containing a file named one of pytorch_model.bin, tf_model.h5, model.ckpt.