-
Notifications
You must be signed in to change notification settings - Fork 245
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
[DRAFT] Generation refactor #1425
Draft
mattdangerw
wants to merge
1
commit into
keras-team:master
Choose a base branch
from
mattdangerw:generation-refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mattdangerw
force-pushed
the
generation-refactor
branch
5 times, most recently
from
February 14, 2024 03:12
5dce72d
to
f96b5f2
Compare
mattdangerw
added a commit
to mattdangerw/keras-hub
that referenced
this pull request
Feb 16, 2024
We will update our samplers in the near future to push the backend specific compilation details out: keras-team#1425 Also in general, we want our documentation to reflect the main usage of our classes, which is using them with Seq2SeqLM and CausalLM classes. So with that in mind, this updates our sampler docs to show the practical usage of the sampling classes with our modeling classes. For the base class, we show the main use case of overriding the `get_next_token()` function.
mattdangerw
added a commit
to mattdangerw/keras-hub
that referenced
this pull request
Feb 17, 2024
We will update our samplers in the near future to push the backend specific compilation details out: keras-team#1425 Also in general, we want our documentation to reflect the main usage of our classes, which is using them with Seq2SeqLM and CausalLM classes. So with that in mind, this updates our sampler docs to show the practical usage of the sampling classes with our modeling classes. For the base class, we show the main use case of overriding the `get_next_token()` function.
mattdangerw
added a commit
to mattdangerw/keras-hub
that referenced
this pull request
Feb 20, 2024
We will update our samplers in the near future to push the backend specific compilation details out: keras-team#1425 Also in general, we want our documentation to reflect the main usage of our classes, which is using them with Seq2SeqLM and CausalLM classes. So with that in mind, this updates our sampler docs to show the practical usage of the sampling classes with our modeling classes. For the base class, we show the main use case of overriding the `get_next_token()` function.
mattdangerw
added a commit
that referenced
this pull request
Feb 20, 2024
We will update our samplers in the near future to push the backend specific compilation details out: #1425 Also in general, we want our documentation to reflect the main usage of our classes, which is using them with Seq2SeqLM and CausalLM classes. So with that in mind, this updates our sampler docs to show the practical usage of the sampling classes with our modeling classes. For the base class, we show the main use case of overriding the `get_next_token()` function.
abuelnasr0
pushed a commit
to abuelnasr0/keras-nlp
that referenced
this pull request
Apr 2, 2024
We will update our samplers in the near future to push the backend specific compilation details out: keras-team#1425 Also in general, we want our documentation to reflect the main usage of our classes, which is using them with Seq2SeqLM and CausalLM classes. So with that in mind, this updates our sampler docs to show the practical usage of the sampling classes with our modeling classes. For the base class, we show the main use case of overriding the `get_next_token()` function.
mattdangerw
force-pushed
the
generation-refactor
branch
from
April 13, 2024 01:04
f96b5f2
to
52b3d77
Compare
keras_nlp/models/causal_lm.py
Outdated
@@ -373,11 +543,11 @@ def postprocess(x): | |||
inputs = inputs.prefetch(tf.data.AUTOTUNE) | |||
else: | |||
# Fast path for non-dataset, single-batch input. | |||
inputs = [preprocess(x) for x in inputs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for list inputs correct?
divyashreepathihalli
approved these changes
May 1, 2024
mattdangerw
force-pushed
the
generation-refactor
branch
from
July 25, 2024 02:21
52b3d77
to
071f352
Compare
Tusespifump1o
added a commit
to Tusespifump1o/keras-nlp
that referenced
this pull request
Aug 26, 2024
We will update our samplers in the near future to push the backend specific compilation details out: keras-team/keras-hub#1425 Also in general, we want our documentation to reflect the main usage of our classes, which is using them with Seq2SeqLM and CausalLM classes. So with that in mind, this updates our sampler docs to show the practical usage of the sampling classes with our modeling classes. For the base class, we show the main use case of overriding the `get_next_token()` function.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
prefill()
anddecode()
functions, which can be overridden from subclass.This will preserve all high level usages (
generate()
,compile(sampler="top-k")
, etc), and the way to subclass aSampler
. However it will break compat on the way you have to call a sampler--that's kinda the point of the pr. Should be an improvement overall, but definitely a friction there.Will continue to flesh this out and add a colab demo.