Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[M2M100Tokenizer] fix _build_translation_inputs #14382

Merged
merged 4 commits into from
Nov 13, 2021

Conversation

patil-suraj
Copy link
Contributor

What does this PR do?

The _build_translation_inputs method of M2M100Tokenizer hardcodes the return_tensors argument, but it's also passed as a extra_kwargs in translation pipeline. So the pipeline fails with the error

TypeError: M2M100Tokenizer object got multiple values for keyword argument 'return_tensors'

This PR adds return_tensors parameter to _build_translation_inputs.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

src/transformers/models/m2m_100/tokenization_m2m_100.py Outdated Show resolved Hide resolved
src/transformers/models/m2m_100/tokenization_m2m_100.py Outdated Show resolved Hide resolved
patil-suraj and others added 2 commits November 13, 2021 19:47
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
@patil-suraj patil-suraj merged commit 2e60276 into huggingface:master Nov 13, 2021
@patil-suraj patil-suraj deleted the fix-m2m-tokenizer branch November 13, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants