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

Begin to add CTC HLG decoding #349

Merged
merged 11 commits into from
Oct 8, 2023
Merged

Begin to add CTC HLG decoding #349

merged 11 commits into from
Oct 8, 2023

Conversation

csukuangfj
Copy link
Collaborator

No description provided.

@csukuangfj
Copy link
Collaborator Author

Usage of this PR

Download pre-trained zipformer CTC model

git lfs install
git clone https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-ctc-en-2023-10-02

ls -lh sherpa-onnx-zipformer-ctc-en-2023-10-02/
-rw-r--r--@ 1 fangjun  staff   3.8M Oct  7 02:45 H.fst
-rw-r--r--@ 1 fangjun  staff    27M Oct  7 02:45 HL.fst
-rw-r--r--@ 1 fangjun  staff   334M Oct  7 02:45 HLG.fst
-rw-r--r--@ 1 fangjun  staff   309B Oct  7 02:45 README.md
-rw-r--r--@ 1 fangjun  staff    67M Oct  7 02:45 model.int8.onnx
-rw-r--r--@ 1 fangjun  staff   249M Oct  7 02:45 model.onnx
drwxr-xr-x@ 5 fangjun  staff   160B Oct  7 02:45 test_wavs
-rw-r--r--@ 1 fangjun  staff   4.9K Oct  7 02:45 tokens.txt
-rw-r--r--@ 1 fangjun  staff   2.9M Oct  7 02:45 words.txt

Decoding with H

./build/bin/sherpa-onnx-offline \
  --model-type=zipformer2_ctc \
  --ctc.graph=./sherpa-onnx-zipformer-ctc-en-2023-10-02/H.fst \
  --zipformer-ctc-model=./sherpa-onnx-zipformer-ctc-en-2023-10-02/model.onnx \
  --tokens=./sherpa-onnx-zipformer-ctc-en-2023-10-02/tokens.txt \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/0.wav  \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/1.wav \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/2.wav

Decoding with HL

./build/bin/sherpa-onnx-offline \
  --model-type=zipformer2_ctc \
  --ctc.graph=./sherpa-onnx-zipformer-ctc-en-2023-10-02/HL.fst \
  --zipformer-ctc-model=./sherpa-onnx-zipformer-ctc-en-2023-10-02/model.onnx \
  --tokens=./sherpa-onnx-zipformer-ctc-en-2023-10-02/tokens.txt \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/0.wav  \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/1.wav \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/2.wav

Decoding with HLG

./build/bin/sherpa-onnx-offline \
  --model-type=zipformer2_ctc \
  --ctc.graph=./sherpa-onnx-zipformer-ctc-en-2023-10-02/HLG.fst \
  --zipformer-ctc-model=./sherpa-onnx-zipformer-ctc-en-2023-10-02/model.onnx \
  --tokens=./sherpa-onnx-zipformer-ctc-en-2023-10-02/tokens.txt \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/0.wav  \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/1.wav \
  ./sherpa-onnx-zipformer-ctc-en-2023-10-02/test_wavs/2.wav

@csukuangfj csukuangfj merged commit 4076024 into k2-fsa:master Oct 8, 2023
133 of 144 checks passed
@csukuangfj csukuangfj deleted the ctc-hlg branch October 8, 2023 03:32
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.

1 participant