Instructions to use mental/mental-roberta-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mental/mental-roberta-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="mental/mental-roberta-base")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("mental/mental-roberta-base") model = AutoModelForMaskedLM.from_pretrained("mental/mental-roberta-base") - Notebooks
- Google Colab
- Kaggle
Unable to run MentalRoBERTa
Hello,
I am trying to use MentalRoBERTa on kaggle.
However, I am getting the following error.
OSError: mental/mental-roberta-base is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with use_auth_token or log in with huggingface-cli login and pass use_auth_token=True.
Hi,
You need to pass the auth token to access the model. A simple but non-secure way of accessing the library is:
tokenizer = AutoTokenizer.from_pretrained("mental/mental-roberta-base", use_auth_token="your_actual_token_here")
model = AutoModelForSequenceClassification.from_pretrained("mental/mental-roberta-base", use_auth_token="your_actual_token_here")
I recommend you save your token as an environment variable and access it this way instead, but the above will at least get you started.