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

Fix fine-tuning translation scripts #9809

Merged
merged 1 commit into from Jan 26, 2021

Conversation

mbiesialska
Copy link
Contributor

@mbiesialska mbiesialska commented Jan 26, 2021

What does this PR do?

In the seq2seq README.md there are some errors. This PR fixes typos that cause the following problem:

Traceback (most recent call last):
  File "transformers/examples/seq2seq/run_seq2seq.py", line 536, in <module>
    main()
  File "transformers/examples/seq2seq/run_seq2seq.py", line 419, in main
    load_from_cache_file=not data_args.overwrite_cache,
  File ".../lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1240, in map
    update_data = does_function_return_dict(test_inputs, test_indices)
  File ".../lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1211, in does_function_return_dict
    function(*fn_args, indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs)
  File "transformers/examples/seq2seq/run_seq2seq.py", line 388, in preprocess_function
    inputs = [ex[source_lang] for ex in examples["translation"]]
  File "transformers/examples/seq2seq/run_seq2seq.py", line 388, in <listcomp>
    inputs = [ex[source_lang] for ex in examples["translation"]]
KeyError: 'en-XX'

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).

Who can review?

@sgugger, @patil-suraj

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!

@sgugger sgugger merged commit 8f6c12d into huggingface:master Jan 26, 2021
@mbiesialska mbiesialska deleted the fix-translation branch January 26, 2021 16:32
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.

None yet

2 participants