MCPcopy Create free account
hub / github.com/huggingface/transformers / prepare_bart_inputs_dict

Function prepare_bart_inputs_dict

tests/test_modeling_bart.py:101–109  ·  view source on GitHub ↗
(
    config, input_ids, attention_mask=None,
)

Source from the content-addressed store, hash-verified

99
100
101def prepare_bart_inputs_dict(
102 config, input_ids, attention_mask=None,
103):
104 if attention_mask is None:
105 attention_mask = input_ids.ne(config.pad_token_id)
106 return {
107 "input_ids": input_ids,
108 "attention_mask": attention_mask,
109 }
110
111
112@require_torch

Calls

no outgoing calls

Tested by

no test coverage detected