Instructions to use hadifar/eventclassifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hadifar/eventclassifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hadifar/eventclassifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hadifar/eventclassifier") model = AutoModelForSequenceClassification.from_pretrained("hadifar/eventclassifier") - Notebooks
- Google Colab
- Kaggle
RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification
As a beginner, I have encountered some issues while using your model. When using AutoModelForSequenceClassific.from_pretrained, or even RobertaForSequenceClassific.from_pretrained, I encountered an error as shown in the following :
RuntimeError: Error (s) in loading state_dict for RobertaForSequenceClassification:
Size mismatch for classifier. out proj. weight: copying a param with shape torch Size ([16, 768]) from checkpoint, the shape in current model is torch Size ([36, 768])
Size mismatch for classifier. out proj. bias: copying a param with shape torch Size ([16]) from checkpoint, the shape in current model is torch Size ([36])
You may consider adding ignore_mismatched_sizes=True in the model free_pretrained method.
How can I resolve this issue? thanks