From e5f71ecaae50ea476d1e12351003790273c4b2ed Mon Sep 17 00:00:00 2001 From: Zafir Stojanovski Date: Tue, 7 May 2024 11:23:52 +0200 Subject: [PATCH] Updated docs of `forward` in `Idefics2ForConditionalGeneration` with correct `ignore_index` value (#30678) updated docs of `forward` in `Idefics2ForConditionalGeneration` with correct `ignore_index` value --- src/transformers/models/idefics2/modeling_idefics2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/models/idefics2/modeling_idefics2.py b/src/transformers/models/idefics2/modeling_idefics2.py index 7f61e95a9b..d0e9915806 100644 --- a/src/transformers/models/idefics2/modeling_idefics2.py +++ b/src/transformers/models/idefics2/modeling_idefics2.py @@ -1776,9 +1776,9 @@ class Idefics2ForConditionalGeneration(Idefics2PreTrainedModel): Args: labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked language modeling loss. Indices should either be in `[0, ..., - config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored - (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`. - + config.vocab_size]` or `model.image_token_id` (where `model` is your instance of `Idefics2ForConditionalGeneration`). + Tokens with indices set to `model.image_token_id` are ignored (masked), the loss is only + computed for the tokens with labels in `[0, ..., config.vocab_size]`. Returns: Example: