Skip to content
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

[runtime] refactor decoder, asr_model to support more platforms #993

Merged
merged 6 commits into from
Mar 29, 2022

Conversation

robin1001
Copy link
Collaborator

@robin1001 robin1001 commented Mar 26, 2022

refactor the decoder and asr model to support more platforms in the future, such as onnx, j3, and so on.

TODO

  • undefined reference error fix.
  • asr model copy since there is inner state in asr_model now
  • accuracy test, as the following, there is some bug in the old code when endpoint is triggerred. So the accuracy is slightlty different.
  // 3. Cache feature for next chunk
  if (state == DecodeState::kEndBatch) {
    // TODO(Binbin Zhang): Only deal the case when
    // chunk_feats.size() > cached_feature_size_ here, and it's consistent
    // with our current model, refine it later if we have new model or
    // new requirements
    CHECK(chunk_feats.size() >= cached_feature_size);
    cached_feature_.resize(cached_feature_size);
    for (int i = 0; i < cached_feature_size; ++i) {
      cached_feature_[i] = std::move(
          chunk_feats[chunk_feats.size() - cached_feature_size + i]);
    }
  }

@robin1001 robin1001 marked this pull request as ready for review March 28, 2022 09:44
runtime/core/utils/utils.cc Show resolved Hide resolved
runtime/core/decoder/torch_asr_model.cc Outdated Show resolved Hide resolved
runtime/core/decoder/asr_decoder.h Show resolved Hide resolved
@xingchensong xingchensong merged commit 58c6ee4 into main Mar 29, 2022
@xingchensong xingchensong deleted the binbin-refactor-decoder branch March 29, 2022 09:28
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.

2 participants