Instructions to use FacebookAI/xlm-roberta-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FacebookAI/xlm-roberta-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="FacebookAI/xlm-roberta-large")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("FacebookAI/xlm-roberta-large") model = AutoModelForMaskedLM.from_pretrained("FacebookAI/xlm-roberta-large") - Inference
- Notebooks
- Google Colab
- Kaggle
how to add dropout in xlm-roberta-large model ?
Hi everyone,
I am working on a problem where I have to increase the classification accuracy of xlm-roberta-large model. I have to add the dropouts in the model to mitigate overfitting. Is there a way to achieve that?
thanks in advance
Shaukat
Hey @Shaukat ,
Sure you can add dropout to the model simply by setting hidden_dropout_prob or attention_probs_dropout_prob in the config, e.g.:
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
model = AutoModelForMaskedLM.from_pretrained("xlm-roberta-large", hidden_dropout_prob=0.3, attention_probs_dropout_prob=0.25)
Hi @patrickvonplaten , @Shaukat
many thanks for your comment. I am fine tunning gpt-neo and wondering if I can increase the drop out as above ? after that is still model good for fine tunning with a new dataset as a pretrained model?
or the model need to be retrain and I can't use it for fine tunning with my own dataset?
