diff --git a/paddlespeech/s2t/exps/u2/model.py b/paddlespeech/s2t/exps/u2/model.py index 32311c88298dfff45691d631ac29bf0c0df60513..22d4238ac832fa79fec3b3286ef3e64c16937441 100644 --- a/paddlespeech/s2t/exps/u2/model.py +++ b/paddlespeech/s2t/exps/u2/model.py @@ -212,7 +212,8 @@ class U2Trainer(Trainer): msg += f" {k.split(',')[0]}: " msg += f"{v:>.8f}" if isinstance(v, float) else f"{v}" - msg += f" {k.split(',')[1]}" if len(k.split(',')) == 2 else f"" + msg += f" {k.split(',')[1]}" if len( + k.split(',')) == 2 else f"" msg += "," msg = msg[:-1] # remove the last "," if (batch_index + 1 diff --git a/requirements.txt b/requirements.txt index 08f68449ec468812aa84ec614b15ca1b1a2e447b..2b34d36bdb467e0286c5d1e87d2f1383a9356f98 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,6 +33,7 @@ sentencepiece snakeviz soundfile~=0.10 sox +soxbindings tensorboardX textgrid timer diff --git a/tools/extras/install_mfa_v1.sh b/tools/extras/install_mfa_v1.sh new file mode 100755 index 0000000000000000000000000000000000000000..fa5b4801ecad48aa1c21993869b29a4fd7c3f1ae --- /dev/null +++ b/tools/extras/install_mfa_v1.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +test -d montreal-forced-aligner || wget --no-check-certificate https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner/releases/download/v1.0.1/montreal-forced-aligner_linux.tar.gz +tar xvf montreal-forced-aligner_linux.tar.gz \ No newline at end of file diff --git a/tools/extras/install_mfa.sh b/tools/extras/install_mfa_v2.sh similarity index 100% rename from tools/extras/install_mfa.sh rename to tools/extras/install_mfa_v2.sh diff --git a/tools/extras/install_sclite.sh b/tools/extras/install_sclite.sh new file mode 100755 index 0000000000000000000000000000000000000000..da89e60db2eb2c17800fbde9679862e54dfa95a1 --- /dev/null +++ b/tools/extras/install_sclite.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +WGET="wget --no-check-certificate" + +# SCTK official repo does not have version tags. Here's the mapping: +# # 2.4.9 = 659bc36; 2.4.10 = d914e1b; 2.4.11 = 20159b5. +SCTK_GITHASH=20159b5 +SCTK_CXFLAGS="-w -march=native" +CFLAGS="CFLAGS=${SCTK_CXFLAGS}" +CXXFLAGS="CXXFLAGS=-std=c++11 ${SCTK_CXFLAGS}" + +MAKE=make + + +${WGET} -nv -T 10 -t 3 -O sctk-${SCTK_GITHASH}.tar.gz https://github.com/usnistgov/SCTK/archive/${SCTK_GITHASH}.tar.gz; +tar zxvf sctk-${SCTK_GITHASH}.tar.gz +rm -rf sctk-${SCTK_GITHASH} sctk +mv SCTK-${SCTK_GITHASH}* sctk-${SCTK_GITHASH} +ln -s sctk-${SCTK_GITHASH} sctk +touch sctk-${SCTK_GITHASH}.tar.gz + +rm -f sctk/.compiled +CFLAGS="${SCTK_CXFLAGS}" CXXFLAGS="-std=c++11 ${SCTK_CXFLAGS}" ${MAKE} -C sctk config +CFLAGS="${SCTK_CXFLAGS}" CXXFLAGS="-std=c++11 ${SCTK_CXFLAGS}" ${MAKE} -C sctk all doc +${MAKE} -C sctk install +touch sctk/.compiled \ No newline at end of file diff --git a/tools/extras/install_sox.sh b/tools/extras/install_sox.sh new file mode 100755 index 0000000000000000000000000000000000000000..ddb1151c7b33e9946efab586d53a0827e53fd6e8 --- /dev/null +++ b/tools/extras/install_sox.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +apt install -y libvorbis-dev libmp3lame-dev libmad-ocaml-dev +test -d sox-14.4.2 || wget --no-check-certificate https://nchc.dl.sourceforge.net/project/sox/sox/14.4.2/sox-14.4.2.tar.gz +tar -xvzf sox-14.4.2.tar.gz -C . +cd sox-14.4.2 && ./configure --prefix=/usr/ && make -j4 && make install \ No newline at end of file diff --git a/tools/extras/install_venv.sh b/tools/extras/install_venv.sh new file mode 100755 index 0000000000000000000000000000000000000000..16679b79558bbc1ef8ebf181477d58c16402de16 --- /dev/null +++ b/tools/extras/install_venv.sh @@ -0,0 +1,36 @@ + +#!/bin/bash +# copy from Espnet + +set -euo pipefail + +if [ $# -eq 0 ] || [ $# -gt 2 ]; then + echo "Usage: $0 [venv-path]" + echo "e.g." + echo "$0 \$(which python3)" + exit 1; +elif [ $# -eq 2 ]; then + PYTHON="$1" + VENV="$2" +elif [ $# -eq 1 ]; then + PYTHON="$1" + VENV="venv" +fi + +if ! "${PYTHON}" -m venv --help > /dev/null 2>&1; then + echo "Error: ${PYTHON} is not Python3?" + exit 1 +fi +if [ -e activate_python.sh ]; then + echo "Warning: activate_python.sh already exists. It will be overwritten" +fi + +"${PYTHON}" -m venv ${VENV} +cat << EOF > activate_python.sh +#!/usr/bin/env bash +# THIS FILE IS GENERATED BY tools/setup_venv.sh +. $(cd ${VENV}; pwd)/bin/activate +EOF + +. ./activate_python.sh +python3 -m pip install -U pip wheel \ No newline at end of file