Repository navigation
Conversation
…f assuming prompt length
--------- Co-authored-by: Eugen Beck <ebeck@apptek.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…288) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
I have one suggestion for this label scorer (I can also implement this myself in a separate PR). Speech LLMs usually have a very large vocab, but only a very small percentage of label extensions survive in the beam search. However, all scores are copied from GPU to CPU in every step, therefore I think it would make sense to make RASR copy only the top-max-beam-size scores per hypothesis. |
--------- Co-authored-by: Larissa <larissa.kleppel@rwth-aachen.de> Co-authored-by: Eugen Beck <ebeck@apptek.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Adapt PrefixSpeechLmOnnxLabelScorer to the StatTrackingLabelScorer interface (resetInternal/computeScoreAccessor(s)) and add timing statistics. Remove the duplicate registration of state-managed-onnx outside of the MODULE_ONNX guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `initial-prompt` and `suffix-prompt` parameters as alternatives to the `*-prompt-labels` token id parameters. Text prompts are tokenized with the tokenizer configured in the `tokenizer` sub-component. Since RASR config values can't contain newlines and lose leading/trailing whitespace, the escape sequences \n, \t, \r, \\ and \xHH are replaced before tokenization. Also document the label scorer in the SearchV2 docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Assign states to all scored contexts, not only to the one of several equal contexts that went through the step model - Set historyLength when a context is scored instead of when it is created - Support silence transitions via `silence-updates-history` - Raise an error if a prompt is set but the initializer model has no input for it - Create the tokenizer once in the constructor and forward-declare it in the header - Remove unreachable checks, order definitions as in the header and only link RasrTokenizer with MODULE_ONNX Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The encoder states are only needed for the prefill, so release the input buffer afterwards and build the ONNX encoder states value locally instead of keeping it for the whole segment. The initial scores are kept in a member since the prefill can't be recomputed after the cleanup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yes I think this is a great idea but in a separate PR. It would also ideally come with some modifications to the search so that it only actually iterates over the non-max labels instead of still looping over all possible successors. |
This PR adds a new LabelScorer which can be used for Speech LLMs. Structurally it is roughly similar to the
StateManagedOnnxLabelScorerfrom #206. The main difference is how the initial states are constructed. While theStateMangedOnnxLabelScoreronly gets one or more start labels as initial history while thePrefixSpeechLmOnnxLabelScorerhas a separate initializer ONNX model which gets aninitial-prompt,encoder-statesandsuffix-promptto produce the initial scores and states. Also, theStateManagedOnnxLabelScorerfeeds in the encoder-states at every scoring step while thePrefixSpeechLmOnnxLabelScoreronly feeds the encoder-states for the initialization.Depends on #287.
Prompts can be given as token ids (
initial-prompt-labels,suffix-prompt-labels) or as text(
initial-prompt,suffix-prompt), tokenized with the tokenizer configured undertokenizer.*.