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

Restrict generation to sampling and greedy search #201

Merged
merged 6 commits into from
Aug 28, 2023
Merged

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Aug 25, 2023

This refactors the NeuronModelCausalLM class to override the generate method, allowing to restrict the generation to actually supported configurations.
This also introduces a simpler generation loop for sampling and greedy search, preparing the integration into TGI.

This allows to:
- reject unsupported arguments,
- detect unsupported configurations,
- avoid checking inputs multiple times,
- reset cache for greedy search also.
@dacorvo dacorvo changed the title Restrict generation to actually supported configurations: sampling and greedy search Restrict generation to sampling and greedy search Aug 25, 2023
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@dacorvo dacorvo marked this pull request as ready for review August 25, 2023 15:27
Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>
Copy link
Collaborator

@JingyaHuang JingyaHuang left a comment

Choose a reason for hiding this comment

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

LGTM

@dacorvo dacorvo merged commit 54eed3b into main Aug 28, 2023
9 of 11 checks passed
@dacorvo dacorvo deleted the greedy_search branch August 28, 2023 08:46
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