Merge remote-tracking branch 'dan/master' into bpe-500

This commit is contained in:
Fangjun Kuang 2021-11-09 21:15:23 +08:00
commit 68cd287626
2 changed files with 27 additions and 2 deletions

View File

@ -303,6 +303,10 @@ The commonly used options are:
$ cd egs/librispeech/ASR
$ ./conformer_ctc/decode.py --method ctc-decoding --max-duration 300
# Caution: The above command is tested with a model with vocab size 500.
# The default settings in the master will not work.
# Please see https://github.com/k2-fsa/icefall/issues/103
# We will fix it later and delete this note.
And the following command uses attention decoder for rescoring:
@ -328,6 +332,8 @@ Usage:
.. code-block:: bash
$ cd egs/librispeech/ASR
# NOTE: Tested with a model with vocab size 500.
# It won't work for a model with vocab size 5000.
$ ./conformer_ctc/decode.py \
--epoch 25 \
--avg 1 \
@ -399,7 +405,7 @@ Download the pre-trained model
The following commands describe how to download the pre-trained model:
.. code-block::
.. code-block:: bash
$ cd egs/librispeech/ASR
$ mkdir tmp
@ -410,10 +416,23 @@ The following commands describe how to download the pre-trained model:
.. CAUTION::
You have to use ``git lfs`` to download the pre-trained model.
Otherwise, you will have the following issue when running ``decode.py``:
.. code-block::
_pickle.UnpicklingError: invalid load key, 'v'
To fix that issue, please use:
.. code-block:: bash
cd icefall_asr_librispeech_conformer_ctc
git lfs pull
.. CAUTION::
In order to use this pre-trained model, your k2 version has to be v1.7 or later.
In order to use this pre-trained model, your k2 version has to be v1.9 or later.
After downloading, you will have the following files:

View File

@ -364,6 +364,12 @@ class Nbest(object):
Return a ragged tensor with 2 axes [utt][path_scores].
Its dtype is torch.float64.
"""
# Caution: We need a clone here. `self.fsa.scores` is a
# reference to a tensor representing the last field of an arc
# in the FSA (Remeber that an arc has four fields.) If we later assign
# `self.fsa.scores`, it will also change the scores on every arc, which
# means saved_scores will also be changed if we don't use `clone()`
# here.
saved_scores = self.fsa.scores.clone()
# The `scores` of every arc consists of `am_scores` and `lm_scores`