-
Notifications
You must be signed in to change notification settings - Fork 0
[#SAMPLE-6] Add state to logits processing #3
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
base: main
Are you sure you want to change the base?
Conversation
|
@xhr15 that should be everything we need for stateful logit processors in general. |
| initial_suppressed_index = Nx.tensor([opts[:initial_suppressed_index]]) | ||
|
|
||
| suppressed_index = | ||
| context.logits_processor_states[:next_suppressed_index] || initial_suppressed_index |
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.
| context.logits_processor_states[:next_suppressed_index] || initial_suppressed_index | |
| context.logits_processor_state[:next_suppressed_index] || initial_suppressed_index |
| length: Enum.count(sequence, &(&1 != 0)), | ||
| input_length: 1 | ||
| input_length: 1, | ||
| logits_processor_states: %{} |
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.
| logits_processor_states: %{} | |
| logits_processor_state: %{} |
The individual processor function see only a state, not all states of the batch
```
** (RuntimeError) unexpected vectorized axes in evaluator for operation :add: #Nx.Tensor<
vectorized[batch: 1]
s32[1]
Nx.Defn.Expr
tensor a s32[1]
b = reshape a s32[1][1]
```
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
604b60e to
572b748
Compare
572b748 to
ce92584
Compare
…er all batches now
…ictly related to statefull processing
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
No description provided.