text_plain_output_1.png
import torch

import transformers as ppb

DEVICE = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')

model_class, tokenizer_class, pretrained_weights = (ppb.DistilBertModel, ppb.DistilBertTokenizer, 'distilbert-base-uncased')
tokenizer = tokenizer_class.from_pretrained(pretrained_weights)
model = model_class.from_pretrained(pretrained_weights).to(DEVICE)