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

Generate: assisted decoding now uses generate for the assistant #28030

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

gante
Copy link
Member

@gante gante commented Dec 14, 2023

What does this PR do?

Subset of the original changes in #27979

"Reworks assisted candidate generation to call .generate(), instead of having its own custom generation loop. For most models this is nothing more than a nice abstraction. However, for models with a custom generate() function, this means the assistant model will now make use of it! (🤔 does this mean that DistilWhisper gets better numbers with this refactor?)"

The following tests were run locally and are passing:

  1. RUN_SLOW=1 py.test tests/models/whisper/ -k speculative
  2. py.test tests/ -k test_assisted

@gante gante requested a review from amyeroberts December 14, 2023 09:57
@gante gante mentioned this pull request Dec 14, 2023
1 task
@gante gante force-pushed the candidate_refactor branch from 2033a7b to 132d428 Compare December 14, 2023 10:21
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@gante
Copy link
Member Author

gante commented Dec 14, 2023

@amyeroberts the failing test is also failing in the daily CI (i.e. unrelated to this PR, as it doesn't depend on assisted generation), and I can't reproduce it on my end 🤔

Copy link
Collaborator

@amyeroberts amyeroberts 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 the refactor and running the slow tests! Looks a lot cleaner ❤️

@gante
Copy link
Member Author

gante commented Dec 14, 2023

@amyeroberts I can't merge due to the failing test (which is also failing on main 👀 ). Would you be able to merge?

@gante
Copy link
Member Author

gante commented Dec 14, 2023

(the test is flaky 👉 #28035)

@amyeroberts
Copy link
Collaborator

amyeroberts commented Dec 14, 2023

@gante In this case we can merge :)

edit: note this was discussed offline as the reason for failing tests was identified and confirmed as independent from this PR

@amyeroberts amyeroberts merged commit 9e5c28c into huggingface:main Dec 14, 2023
19 of 21 checks passed
@gante gante deleted the candidate_refactor branch December 14, 2023 13:56
iantbutler01 pushed a commit to BismuthCloud/transformers that referenced this pull request Dec 16, 2023
staghado pushed a commit to staghado/transformers that referenced this pull request Jan 15, 2024
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.

3 participants