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

Support CTC decoding on CPU using OpenFst and kaldi decoders. #1244

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

csukuangfj
Copy link
Collaborator

No description provided.

@csukuangfj csukuangfj changed the title Support CTC decoding on CPU using OpenFST and kaldi decoders. Support CTC decoding on CPU using OpenFst and kaldi decoders. Sep 7, 2023
@csukuangfj
Copy link
Collaborator Author

Please see the CI logs for usages.

https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:21

python3 ./tdnn/jit_pretrained_decode_with_H.py \
      --nn-model ./tdnn/exp/cpu_jit.pt \
      --H ./data/lang_phone/H.fst \
      --tokens ./data/lang_phone/tokens.txt \
      ./download/waves_yesno/0_0_0_1_0_0_0_1.wav \
      ./download/waves_yesno/0_0_1_0_0_0_1_0.wav \
      ./download/waves_yesno/0_0_1_0_0_1_1_1.wav
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
/home/runner/work/icefall/icefall:
2023-0[9](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:9)-07 14:17:41,615 INFO [export.py:76] {'exp_dir': PosixPath('tdnn/exp'), 'lang_dir': PosixPath('data/lang_phone'), 'lr': 0.01, 'feature_dim': 23, 'weight_decay': 1e-06, 'start_epoch': 0, 'best_train_loss': inf, 'best_valid_loss': inf, 'best_train_epoch': -1, 'best_valid_epoch': -1, 'batch_idx_train': 0, 'log_interval': [10](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:10), 'reset_interval': 20, 'valid_interval': 10, 'beam_size': 10, 'reduction': 'sum', 'use_double_scores': True, 'epoch': 14, 'avg': 2, 'jit': True}
2023-09-07 14:17:41,616 INFO [lexicon.py:168] Loading pre-compiled data/lang_phone/Linv.pt
2023-09-07 14:17:41,618 INFO [export.py:93] averaging ['tdnn/exp/epoch-[13](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:13).pt', 'tdnn/exp/epoch-[14](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:14).pt']
2023-09-07 14:17:41,622 INFO [export.py:100] Using torch.jit.script
2023-09-07 14:17:41,685 INFO [export.py:104] Saved to tdnn/exp/cpu_jit.pt
2023-09-07 14:17:43,340 INFO [jit_pretrained_decode_with_H.py:[15](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:15)0] device: cpu
2023-09-07 14:17:43,340 INFO [jit_pretrained_decode_with_H.py:152] Loading torchscript model
2023-09-07 14:17:43,363 INFO [jit_pretrained_decode_with_H.py:157] Loading H from ./data/lang_phone/H.fst
2023-09-07 14:17:43,363 INFO [jit_pretrained_decode_with_H.py:[16](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:16)2] Constructing Fbank computer
2023-09-07 14:[17](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:17):43,363 INFO [jit_pretrained_decode_with_H.py:172] Reading sound files: ['./download/waves_yesno/0_0_0_1_0_0_0_1.wav', './download/waves_yesno/0_0_1_0_0_0_1_0.wav', './download/waves_yesno/0_0_1_0_0_1_1_1.wav']
[20](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:21)[23](https://github.com/k2-fsa/icefall/actions/runs/6110904739/job/16584973570?pr=1244#step:10:24)-09-07 14:17:43,365 INFO [jit_pretrained_decode_with_H.py:178] Decoding started
2023-09-07 14:17:43,613 INFO [jit_pretrained_decode_with_H.py:201] 
./download/waves_yesno/0_0_0_1_0_0_0_1.wav:
N N N Y N N N Y

./download/waves_yesno/0_0_1_0_0_0_1_0.wav:
N N Y N N N Y N

./download/waves_yesno/0_0_1_0_0_1_1_1.wav:
N N Y N N Y Y Y


2023-09-07 14:17:43,613 INFO [jit_pretrained_decode_with_H.py:203] Decoding Done

@csukuangfj csukuangfj added the ctc label Sep 26, 2023
@csukuangfj csukuangfj added ctc and removed ctc labels Sep 26, 2023
@csukuangfj csukuangfj merged commit 2318c3f into k2-fsa:master Sep 26, 2023
3 checks passed
@csukuangfj csukuangfj deleted the ctc branch September 26, 2023 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant