Instructions to use FacebookAI/roberta-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FacebookAI/roberta-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="FacebookAI/roberta-base")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("FacebookAI/roberta-base") model = AutoModelForMaskedLM.from_pretrained("FacebookAI/roberta-base") - Inference
- Notebooks
- Google Colab
- Kaggle
I can't download or use Roberta-base?
#9
by gg7878 - opened
Traceback (most recent call last):
File "/Users/hqz/Documents/download_roberta.py", line 14, in
tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
File "/Users/hqz/opt/anaconda3/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1788, in from_pretrained
raise EnvironmentError(
OSError: Can't load tokenizer for 'roberta-base'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'roberta-base' is the correct path to a directory containing all relevant files for a RobertaTokenizer tokenizer.