Всем привет! Подскажите, не могу сообразить, как мне переписать код чтобы использовать батчи? Наверняка же есть стандартная обертка. Памяти не хватает.
# Using BERT for the First TIme
# !pip install transformers
# model_class, tokenizer_class, pretrained_weights = (ppb.DistilBertModel, ppb.DistilBertTokenizer, 'distilbert-base-uncased')
# model = model_class.from_pretrained(pretrained_weights)
with torch.no_grad():
last_hidden_states = model(input_ids, attention_mask=attention_mask)