Skip to content

Instantly share code, notes, and snippets.

@kedisho
Created December 14, 2022 16:26
Show Gist options
  • Save kedisho/e1619bca46f932341ee84684bbbbd6f4 to your computer and use it in GitHub Desktop.
Save kedisho/e1619bca46f932341ee84684bbbbd6f4 to your computer and use it in GitHub Desktop.
from transformers import XLMRobertaTokenizerFast
from transformers import XLMRobertaForSequenceClassification
BERT_MODEL = " xlm-roberta-base "
tokenizer = XLMRobertaTokenizerFast.from_pretrained(BERT_MODEL)
model = XLMRobertaForSequenceClassification.from_pretrained(BERT_MODEL, num_labels = len(label2idx))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment