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

[Doctest] Setup, quicktour and task_summary #13078

Merged
merged 7 commits into from
Aug 11, 2021
Merged

[Doctest] Setup, quicktour and task_summary #13078

merged 7 commits into from
Aug 11, 2021

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Aug 11, 2021

What does this PR do?

This PR starts the work of re-enabling the doc tests and makes sure our documentation uses the latest version of the APIs. For the doctest setup, it registers the options we will need for doctest in the setup.cfg.

For the quicktour and task_summary, it tweaks all results to match the output of the code so the doctests pass for those two files, and removes the use of deprecated APIs (AutoModelWithLMHead) as well as favoring the call method of the tokenizers over the encode method.

@sgugger sgugger requested a review from LysandreJik August 11, 2021 08:57
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Great, you caught a few API errors (such as tokenizer.encode -> tokenizer() or the switch to ForMaskedLM/ForCausalLM)! This is important work, thank you @sgugger.

LGTM!

Comment on lines +53 to +54
[tool:pytest]
doctest_optionflags=NUMBER NORMALIZE_WHITESPACE ELLIPSIS
Copy link
Member

Choose a reason for hiding this comment

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

Nice, life-saving options!

@sgugger sgugger merged commit 83424ad into master Aug 11, 2021
@sgugger sgugger deleted the quicktour_doctest branch August 11, 2021 11:45
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