OSError: Unable to load weights from pytorch checkpoint file for 'SentiApp/models/DISTILBERT_sentence/' at 'SentiApp/models/DISTILBERT_sentence/pytorch_model.bin'If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. #255
@EricFillion I am getting an error that a few days ago I did not have, this happens when I try to load the model that I have saved.
Traceback
File "/home/ubuntu/IS-API/SentiApp/DISTILBERT_sentence_predictor.py", line 14, in <module>
happy_tc = HappyTextClassification(load_path=model_path, num_labels=10)
File "/home/ubuntu/IS-API/env/lib/python3.8/site-packages/happytransformer/happy_text_classification.py", line 34, in __init__
model = AutoModelForSequenceClassification.from_pretrained(load_path, config=config)
File "/home/ubuntu/IS-API/env/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 384, in from_pretrained
return model_class.from_pretrained(pretrained_model_name_or_path, *model_args, config=config, **kwargs)
File "/home/ubuntu/IS-API/env/lib/python3.8/site-packages/transformers/modeling_utils.py", line 1285, in from_pretrained
raise OSError(
OSError: Unable to load weights from pytorch checkpoint file for 'SentiApp/models/DISTILBERT_sentence/' at 'SentiApp/models/DISTILBERT_sentence/pytorch_model.bin'If you tried to load a PyTorch model from a TF 2.0 checkpoint, please
set from_tf=True.
@EricFillion I am getting an error that a few days ago I did not have, this happens when I try to load the model that I have saved.
Traceback
Code where the error is happening