From 1321356bdf54a6c11048851bff98c2a0181f2084 Mon Sep 17 00:00:00 2001 From: Mohamed Al Salti Date: Fri, 12 Feb 2021 19:18:39 +0200 Subject: [PATCH] Fix typo in GPT2DoubleHeadsModel docs (#10148) * Fix typo * apply suggestion Co-authored-by: Suraj Patil --- src/transformers/models/gpt2/modeling_gpt2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/models/gpt2/modeling_gpt2.py b/src/transformers/models/gpt2/modeling_gpt2.py index eb4088b5e3..60eb3d69a2 100644 --- a/src/transformers/models/gpt2/modeling_gpt2.py +++ b/src/transformers/models/gpt2/modeling_gpt2.py @@ -1039,8 +1039,8 @@ class GPT2DoubleHeadsModel(GPT2PreTrainedModel): 1[``. labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`): Labels for language modeling. Note that the labels **are shifted** inside the model, i.e. you can set - ``labels = input_ids`` Indices are selected in ``[-1, 0, ..., config.vocab_size]`` All labels set to - ``-100`` are ignored (masked), the loss is only computed for labels in ``[0, ..., config.vocab_size]`` + ``labels = input_ids`` Indices are selected in ``[-100, 0, ..., config.vocab_size - 1]`` All labels set to + ``-100`` are ignored (masked), the loss is only computed for labels in ``[0, ..., config.vocab_size - 1]`` mc_labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size)`, `optional`): Labels for computing the multiple choice classification loss. Indices should be in ``[0, ..., num_choices]`` where `num_choices` is the size of the second dimension of the input tensors. (see