Skip to content

Instantly share code, notes, and snippets.

@kedisho
Created December 14, 2022 16:25
Show Gist options
  • Save kedisho/dc2e8ace3af3e49b4b2c4b415adfa4f3 to your computer and use it in GitHub Desktop.
Save kedisho/dc2e8ace3af3e49b4b2c4b415adfa4f3 to your computer and use it in GitHub Desktop.
from transformers import BertTokenizer
from transformers import BertForSequenceClassification
BERT_MODEL = "distilbert-base-cased"
tokenizer = DistilBertTokenizer.from_pretrained(BERT_MODEL)
model = DistilBertForSequenceClassification.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