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

refactor: default for max_new_tokens to 512 in Hugging Face generators #7370

Conversation

CKeibel
Copy link
Contributor

@CKeibel CKeibel commented Mar 15, 2024

Related Issues

Proposed Changes:

  1. Set a default value for max_new_tokens to 515 in "Hugging Face generators".
  2. Adjustment of the tests that fail due to the change.

How did you test it?

Initialization tests had already been implemented but were adjusted based on the change.

Notes for the reviewer

There were several tests that were adjusted differently. I hope that the changes are correct, otherwise I will fix them as soon as possible.

There have been changes to the imports that I did not add on my own (I don't know if the pre-commit hooks can influence this or where they come from). If these seem strange, I will fix them as soon as possible.

@CKeibel CKeibel requested a review from a team as a code owner March 15, 2024 15:17
@CKeibel CKeibel requested review from julian-risch and removed request for a team March 15, 2024 15:17
@CLAassistant
Copy link

CLAassistant commented Mar 15, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 labels Mar 15, 2024
@CKeibel CKeibel requested a review from a team as a code owner March 16, 2024 10:48
@CKeibel CKeibel requested review from dfokina and removed request for a team March 16, 2024 10:48
@coveralls
Copy link
Collaborator

coveralls commented Mar 18, 2024

Pull Request Test Coverage Report for Build 8330363069

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 11 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.006%) to 89.21%

Files with Coverage Reduction New Missed Lines %
components/generators/hugging_face_local.py 1 95.08%
components/generators/chat/hugging_face_tgi.py 5 94.74%
components/generators/hugging_face_tgi.py 5 94.44%
Totals Coverage Status
Change from base Build 8326632443: 0.006%
Covered Lines: 5374
Relevant Lines: 6024

💛 - Coveralls

Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

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

Looks very good to me! 👍 @CKeibel Thank you for your contribution to Haystack. I just adjusted four tests to make them pass and slightly changed the release note.
The changes to the import statements were added by the pre-commit hooks and they are correct. The change is just about the sorting of the imports.
Congratulations! Looking forward to more PRs from you! 🙂

@julian-risch
Copy link
Member

Hey @CKeibel have you already signed the contributor license agreement? Before we can merge your PR, we need you to sign it please: #7370 (comment)

@CKeibel
Copy link
Contributor Author

CKeibel commented Mar 18, 2024

Hey @CKeibel have you already signed the contributor license agreement? Before we can merge your PR, we need you to sign it please: #7370 (comment)

Yes, I signed it on Friday but somehow it doesn't seem to update. But I can have another look :)

@CKeibel
Copy link
Contributor Author

CKeibel commented Mar 18, 2024

Apparently my local git setting must have been wrong, the user who made the commits is called christopherkeibel and not CKeibel. I'll have to see how I can fix it afterwards, because the CLA is signed with CKeibel.

@CKeibel
Copy link
Contributor Author

CKeibel commented Mar 18, 2024

Hey @julian-risch , apparently I have to edit my commits with a rebase. I'll do that later when I get home from work.

@CKeibel CKeibel force-pushed the huggingface-generators-max-new-tokens-default branch from 1aa4d95 to 656a1cf Compare March 18, 2024 16:37
@CKeibel CKeibel force-pushed the huggingface-generators-max-new-tokens-default branch from 656a1cf to 290133e Compare March 18, 2024 16:42
@julian-risch julian-risch merged commit f69c3e5 into deepset-ai:main Mar 19, 2024
23 checks passed
silvanocerza pushed a commit that referenced this pull request Apr 8, 2024
#7370)

* set default for max_new_tokens to 512 in Hugging Face generators

* add release notes

* fix tests

* remove issues from release note

---------

Co-authored-by: christopherkeibel <[email protected]>
Co-authored-by: Julian Risch <[email protected]>
@silvanocerza silvanocerza added this to the 2.0.1 milestone Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants