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

[doc] bart doc examples aren't for bart #6651

Closed
stas00 opened this issue Aug 21, 2020 · 4 comments · Fixed by #6659
Closed

[doc] bart doc examples aren't for bart #6651

stas00 opened this issue Aug 21, 2020 · 4 comments · Fixed by #6659
Assignees

Comments

@stas00
Copy link
Contributor

stas00 commented Aug 21, 2020

If you look at the very end of this section https://huggingface.co/transformers/model_doc/bart.html#transformers.BartForConditionalGeneration.generate
there are 5 examples of using generate none of which is for BART. Is this an accidental copy-n-paste issue and they should just be removed?

There are examples of generate for BART in the pre-amble of the class:
https://huggingface.co/transformers/model_doc/bart.html#bartforconditionalgeneration

@patil-suraj
Copy link
Contributor

Those examples are from the generate method doc which is a generic method shared by all generative models.

@stas00
Copy link
Contributor Author

stas00 commented Aug 21, 2020

Thank you, @patil-suraj. Indeed, since BartForConditionalGeneration uses super-super class's generate it ends up having that generic signature in its docs.

What I'm trying to say is that these example are confusing to the user since not only they are irrelevant to someone trying to use BART, there isn't even an example of using bart in that part of the doc (there is one earlier in the class signature).

e.g. they don't show up in other similar classes which have generate
https://huggingface.co/transformers/model_doc/t5.html#t5forconditionalgeneration
https://huggingface.co/transformers/model_doc/marian.html
but there they have their own generate methods, so this doesn't happen.

I'm trying to flag a poor user experience and asking whether perhaps there is a better way to do it?

One possible suggestion:

@sshleifer
Copy link
Contributor

sshleifer commented Aug 22, 2020

feel free to send a PR deleting generate here
https://github.com/huggingface/transformers/blob/master/docs/source/model_doc/bart.rst#L35

@sshleifer sshleifer self-assigned this Aug 22, 2020
stas00 added a commit to stas00/transformers that referenced this issue Aug 22, 2020
As suggested here: huggingface#6651 (comment)
this removes generic `generate` doc with examples not-relevant to bart.
@stas00
Copy link
Contributor Author

stas00 commented Aug 22, 2020

Thank you, Sam.
#6659

JetRunner pushed a commit that referenced this issue Aug 24, 2020
As suggested here: #6651 (comment)
this removes generic `generate` doc with examples not-relevant to bart.
Zigur pushed a commit to Zigur/transformers that referenced this issue Oct 26, 2020
As suggested here: huggingface#6651 (comment)
this removes generic `generate` doc with examples not-relevant to bart.
fabiocapsouza pushed a commit to fabiocapsouza/transformers that referenced this issue Nov 15, 2020
As suggested here: huggingface#6651 (comment)
this removes generic `generate` doc with examples not-relevant to bart.
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 a pull request may close this issue.

3 participants