Merge pull request #749 from PaddlePaddle/install

fix install and format code
pull/750/head
Hui Zhang 4 years ago committed by GitHub
commit b87b0ea489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,9 +18,7 @@ import sys
import time import time
from collections import defaultdict from collections import defaultdict
from pathlib import Path from pathlib import Path
from typing import List
from typing import Optional from typing import Optional
from typing import Tuple
import numpy as np import numpy as np
import paddle import paddle
@ -42,7 +40,6 @@ from deepspeech.training.scheduler import WarmupLR
from deepspeech.training.trainer import Trainer from deepspeech.training.trainer import Trainer
from deepspeech.utils import bleu_score from deepspeech.utils import bleu_score
from deepspeech.utils import ctc_utils from deepspeech.utils import ctc_utils
from deepspeech.utils import error_rate
from deepspeech.utils import layer_tools from deepspeech.utils import layer_tools
from deepspeech.utils import mp_tools from deepspeech.utils import mp_tools
from deepspeech.utils import text_grid from deepspeech.utils import text_grid

@ -14,7 +14,6 @@
import io import io
from collections import namedtuple from collections import namedtuple
from typing import Optional from typing import Optional
from typing import Tuple
import kaldiio import kaldiio
import numpy as np import numpy as np

@ -15,9 +15,7 @@
Unified Streaming and Non-streaming Two-pass End-to-end Model for Speech Recognition Unified Streaming and Non-streaming Two-pass End-to-end Model for Speech Recognition
(https://arxiv.org/pdf/2012.05481.pdf) (https://arxiv.org/pdf/2012.05481.pdf)
""" """
import sys
import time import time
from collections import defaultdict
from typing import Dict from typing import Dict
from typing import List from typing import List
from typing import Optional from typing import Optional
@ -36,18 +34,14 @@ from deepspeech.modules.decoder import TransformerDecoder
from deepspeech.modules.encoder import ConformerEncoder from deepspeech.modules.encoder import ConformerEncoder
from deepspeech.modules.encoder import TransformerEncoder from deepspeech.modules.encoder import TransformerEncoder
from deepspeech.modules.loss import LabelSmoothingLoss from deepspeech.modules.loss import LabelSmoothingLoss
from deepspeech.modules.mask import make_pad_mask
from deepspeech.modules.mask import mask_finished_preds from deepspeech.modules.mask import mask_finished_preds
from deepspeech.modules.mask import mask_finished_scores from deepspeech.modules.mask import mask_finished_scores
from deepspeech.modules.mask import subsequent_mask from deepspeech.modules.mask import subsequent_mask
from deepspeech.utils import checkpoint from deepspeech.utils import checkpoint
from deepspeech.utils import layer_tools from deepspeech.utils import layer_tools
from deepspeech.utils.ctc_utils import remove_duplicates_and_blank
from deepspeech.utils.log import Log from deepspeech.utils.log import Log
from deepspeech.utils.tensor_utils import add_sos_eos from deepspeech.utils.tensor_utils import add_sos_eos
from deepspeech.utils.tensor_utils import pad_sequence
from deepspeech.utils.tensor_utils import th_accuracy from deepspeech.utils.tensor_utils import th_accuracy
from deepspeech.utils.utility import log_add
__all__ = ["U2STModel", "U2STInferModel"] __all__ = ["U2STModel", "U2STInferModel"]

@ -14,7 +14,6 @@
"""This module provides functions to calculate bleu score in different level. """This module provides functions to calculate bleu score in different level.
e.g. wer for word-level, cer for char-level. e.g. wer for word-level, cer for char-level.
""" """
import numpy as np
import sacrebleu import sacrebleu
__all__ = ['bleu', 'char_bleu'] __all__ = ['bleu', 'char_bleu']

@ -2,7 +2,7 @@
## Data ## Data
| Data Subset | Duration in Seconds | | Data Subset | Duration in Seconds |
| --- | --- | | --- | --- |
| data/manifest.train | 0.83s ~ 29.735s | | data/manifest.train | 0.83s ~ 29.735s |
| data/manifest.dev | 1.065 ~ 35.155s | | data/manifest.dev | 1.065 ~ 35.155s |
| data/manifest.test-clean | 1.285s ~ 34.955s | | data/manifest.test-clean | 1.285s ~ 34.955s |
@ -39,4 +39,4 @@
### Test w/o length filter ### Test w/o length filter
| Model | Params | Config | Augmentation| Test set | Decode method | Loss | WER | | Model | Params | Config | Augmentation| Test set | Decode method | Loss | WER |
| --- | --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- | --- |
| transformer | 32.52 M | conf/transformer.yaml | spec_aug + shift | test-clean-all | attention | 6.98 | 0.066500 | | transformer | 32.52 M | conf/transformer.yaml | spec_aug + shift | test-clean-all | attention | 6.98 | 0.066500 |

@ -39,4 +39,3 @@
| Model | Params | Config | Augmentation| Test set | Decode method | Loss | WER | | Model | Params | Config | Augmentation| Test set | Decode method | Loss | WER |
| --- | --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- | --- |
| transformer | 32.52 M | conf/transformer.yaml | spec_aug + shift | test-clean-all | attention | | | | transformer | 32.52 M | conf/transformer.yaml | spec_aug + shift | test-clean-all | attention | | |

@ -1,7 +1,9 @@
coverage coverage
gpustat
pre-commit pre-commit
pybind11 pybind11
resampy==0.2.2 resampy==0.2.2
sacrebleu
scipy==1.2.1 scipy==1.2.1
sentencepiece sentencepiece
snakeviz snakeviz

@ -9,7 +9,7 @@ if [ $(id -u) -eq 0 ]; then
fi fi
if [ -e /etc/lsb-release ];then if [ -e /etc/lsb-release ];then
#${SUDO} apt-get update ${SUDO} apt-get update -y
${SUDO} apt-get install -y jq vim tig tree sox pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev ${SUDO} apt-get install -y jq vim tig tree sox pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev
if [ $? != 0 ]; then if [ $? != 0 ]; then
error_msg "Please using Ubuntu or install pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev by user." error_msg "Please using Ubuntu or install pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev by user."
@ -22,6 +22,8 @@ fi
rm tools/*.done rm tools/*.done
pushd tools && make && popd pushd tools && make && popd
source tools/venv/bin/activate
# install python dependencies # install python dependencies
if [ -f "requirements.txt" ]; then if [ -f "requirements.txt" ]; then
pip3 install -r requirements.txt pip3 install -r requirements.txt

Loading…
Cancel
Save