Skip to content

Conversation

gante
Copy link
Member

@gante gante commented Aug 23, 2023

What does this PR do?

This PR:

  • Adds logits_processors.py to the doctests
  • Fixes the broken tests (while fixing the tests, also improved the examples with better practices and shorter examples)
  • Updates sample-related examples to much shorter examples (the examples were too long and not very representative of the processor)

@gante gante changed the title Generate: logits processors are doctested and shorter bad_word_ids example Generate: logits processors are doctested and fix bad_word_ids example Aug 23, 2023
@gante gante changed the title Generate: logits processors are doctested and fix bad_word_ids example Generate: logits processors are doctested and fix NoBadWordsLogitsProcessor example Aug 23, 2023
@gante gante requested review from ArthurZucker and ydshieh August 23, 2023 17:29
@gante gante force-pushed the bad_word_ids_shorter_example branch from b0f3787 to b75c45d Compare August 23, 2023 17:33
Copy link
Member Author

Choose a reason for hiding this comment

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

@ydshieh this is enough to make the file part of the doctests, correct? :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes!

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks!

@ydshieh
Copy link
Collaborator

ydshieh commented Aug 23, 2023

It's nice to see the red cross 🔥

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 23, 2023

The documentation is not available anymore as the PR was closed or merged.

@gante
Copy link
Member Author

gante commented Aug 23, 2023

ooh boy 🤦

@ArthurZucker
Copy link
Collaborator

Super glad to see the full power of the tests_pr_documentation_tests on display 🚀

@gante gante force-pushed the bad_word_ids_shorter_example branch from b7b9ef7 to c554bd4 Compare August 24, 2023 13:06
@gante gante changed the title Generate: logits processors are doctested and fix NoBadWordsLogitsProcessor example Generate: logits processors are doctested and fix broken doctests Aug 24, 2023
@gante
Copy link
Member Author

gante commented Aug 24, 2023

@ArthurZucker ready for a review! I've updated the PR header with a summary of the changes :)

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks!

@gante gante merged commit 494e96d into huggingface:main Aug 25, 2023
@gante gante deleted the bad_word_ids_shorter_example branch August 25, 2023 11:42
parambharat pushed a commit to parambharat/transformers that referenced this pull request Sep 26, 2023
…ggingface#25692)

* shorter example

* add logits processors to doctests

* remove file from conflict?

* tmp commit

* Fix broken tests; Shorter sampling tests

* Apply suggestions from code review

Co-authored-by: Arthur <[email protected]>

---------

Co-authored-by: Arthur <[email protected]>
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.

4 participants