Skip to content

Conversation

@joelpaulkoch
Copy link
Member

No description provided.

@joelpaulkoch
Copy link
Member Author

@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
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
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: %{}
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
logits_processor_states: %{}
logits_processor_state: %{}

The individual processor function see only a state, not all states of the batch

joelpaulkoch and others added 5 commits November 7, 2025 14:04
```
** (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>
@xhr15 xhr15 force-pushed the task/sample-6-add-state-to-logits-processing branch from 604b60e to 572b748 Compare November 14, 2025 22:54
@xhr15 xhr15 force-pushed the task/sample-6-add-state-to-logits-processing branch from 572b748 to ce92584 Compare November 14, 2025 22:57
xhr15 and others added 5 commits November 15, 2025 00:10
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