Skip to content

Commit

Permalink
Updated docs of forward in Idefics2ForConditionalGeneration with …
Browse files Browse the repository at this point in the history
…correct `ignore_index` value (#30678)

updated docs of `forward` in `Idefics2ForConditionalGeneration` with correct `ignore_index` value
  • Loading branch information
zafstojano authored May 7, 2024
1 parent 9c8979e commit e5f71ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transformers/models/idefics2/modeling_idefics2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,9 +1776,9 @@ def forward(
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:
Expand Down

0 comments on commit e5f71ec

Please sign in to comment.