Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/transformers/pipelines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ def _parse_and_tokenize(
return_tensors=self.framework,
padding=padding,
truncation=truncation,
**kwargs,
)

return inputs
Expand Down
5 changes: 4 additions & 1 deletion tests/test_pipelines_fill_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ def test_torch_fill_mask(self):
self.assertIsInstance(outputs, list)

# This used to fail with `cannot mix args and kwargs`
outputs = nlp(valid_inputs, something=False)
outputs = nlp(valid_inputs, verbose=False)
self.assertIsInstance(outputs, list)

# This fails because `invalid_arg` is not an argument of the pipeline's tokenizer
self.assertRaises(TypeError, nlp, valid_inputs, invalid_arg=False)

@require_torch
def test_torch_fill_mask_with_targets(self):
valid_inputs = ["My name is <mask>"]
Expand Down