-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add fast beam search emformer #68
Add fast beam search emformer #68
Conversation
if decoding_method == "greedy_search": | ||
decoder_out_list = [] | ||
hyp_list = [] | ||
else: |
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.
Please refactor it in a way that makes it easier to support other decoding methods.
return parser.parse_args() | ||
|
||
|
||
@torch.no_grad() | ||
def run_model_and_do_greedy_search( | ||
def run_model_and_do_search( |
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.
I suggest refactoring it into two functions:
- run_model_and_do_greedy_search
- run_model_and_do_fast_beam_search
It makes the code more readable and more maintainable, I think.
If we want to support another decoding method, we can just create a new function to do that.
It is just a suggestion. You can leave it as it is.
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.
It make sense, I will finish first the work of conv_emformer at first
Could you also update GitHub CI for https://github.com/k2-fsa/sherpa/blob/master/.github/workflows/run-streaming-conv-emformer-test.yaml#L36 to include
You can apply a label to this PR with the name |
Should be all good @csukuangfj ! |
Thanks! Let us wait for the CI. Will merge after all tests pass. Thanks again! |
This PR adds
fast_beam_search_one_best
to the following models :pruned_stateless_emformer_rnnt2
conv_emformer_transducer_stateless