diff --git a/README.md b/README.md index 532b24cc3..da413001a 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Developers can have a try of our model with only a few lines of code. A tiny DeepSpeech2 **Speech-to-Text** model training on toy set of LibriSpeech: ```shell -cd examples/tiny/s0/ +cd examples/tiny/asr0/ # source the environment source path.sh source ../../../utils/parse_options.sh @@ -177,20 +177,20 @@ The current hyperlinks redirect to [Previous Parakeet](https://github.com/Paddle Aishell DeepSpeech2 RNN + Conv based Models - deepspeech2-aishell + deepspeech2-aishell Transformer based Attention Models - u2.transformer.conformer-aishell + u2.transformer.conformer-aishell Librispeech Transformer based Attention Models - deepspeech2-librispeech / transformer.conformer.u2-librispeech / transformer.conformer.u2-kaldi-librispeech + deepspeech2-librispeech / transformer.conformer.u2-librispeech / transformer.conformer.u2-kaldi-librispeech @@ -199,7 +199,7 @@ The current hyperlinks redirect to [Previous Parakeet](https://github.com/Paddle THCHS30 MFA - mfa-thchs30 + mfa-thchs30 @@ -213,7 +213,7 @@ The current hyperlinks redirect to [Previous Parakeet](https://github.com/Paddle TIMIT Unified Streaming & Non-streaming Two-pass - u2-timit + u2-timit diff --git a/dataset/ted_en_zh/ted_en_zh.py b/dataset/ted_en_zh/ted_en_zh.py index 9a3ba3b31..2d1fc6710 100644 --- a/dataset/ted_en_zh/ted_en_zh.py +++ b/dataset/ted_en_zh/ted_en_zh.py @@ -28,7 +28,7 @@ import soundfile parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( - "--src_dir", + "--src-dir", default="", type=str, help="Directory to kaldi splited data. (default: %(default)s)") diff --git a/demos/README.md b/demos/README.md new file mode 100644 index 000000000..2183c1f2d --- /dev/null +++ b/demos/README.md @@ -0,0 +1 @@ +# Demos for PaddleSpeech diff --git a/demos/style_fs2/README.md b/demos/style_fs2/README.md new file mode 100644 index 000000000..b9b0469f8 --- /dev/null +++ b/demos/style_fs2/README.md @@ -0,0 +1,8 @@ +# Style FastSpeech2 +You can change the `pitch`、`duration` and `energy` of `FastSpeech2`. + +Run the following command line to get started: +``` +./run.sh +``` +For more details, please see `style_syn.py` diff --git a/docs/source/install.md b/docs/source/install.md index d68b990d2..d276759b4 100644 --- a/docs/source/install.md +++ b/docs/source/install.md @@ -1,44 +1,103 @@ # Installation -To avoid the trouble of environment setup, [running in Docker container](#running-in-docker-container) is highly recommended. Otherwise follow the guidelines below to install the dependencies manually. +There are 3 ways to use the repository. According to the degree of difficulty, the 3 ways can be divided into Easy, Medium and Hard. + + + +## Easy: Get the Basic Funcition Without Your Own Mechine + +If you are in touch with PaddleSpeech for the first time and want to experience it easily without your own mechine. We recommand you to go to aistudio to experience the PaddleSpeech project. There is a step-by-step tutorial for PaddleSpeech and you can use the basic function of PaddleSpeech with a free machine. + + + +## Prerequisites for Medium and Hard -## Prerequisites - Python >= 3.7 - PaddlePaddle latest version (please refer to the [Installation Guide](https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/index_en.html)) +- Only Linux is supported +- Hip: Do not use command `sh` instead of command `bash` -## Simple Setup -For user who working on `Ubuntu` with `root` privilege. -```python -git clone https://github.com/PaddlePaddle/DeepSpeech.git -cd DeepSpeech -pip install -e . -``` +## Medium: Get the Basic Funciton on Your Mechine -For user who only needs the basic function of paddlespeech, using conda to do installing is recommended. -You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) to select a version and install it by yourself, or you can use the scripts below to install the last miniconda version. +If you want to install the paddlespeech on your own mechine. There are 3 steps you need to do. -```python -pushd tools -bash extras/install_miniconda.sh -popd +### Install the Conda + +The first setup is installing the conda. Conda is environment management system. You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) to select a version (py>=3.7) and install it by yourself or you can use the scripts below: + +```bash +# download the miniconda +wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh +# install the miniconda +bash Miniconda3-latest-Linux-x86_64.sh -b +# conda init +$HOME/miniconda3/bin/conda init +# activate the conda bash ``` -After installing the conda, run the setup.sh to complete the installing process. -```python -bash setup.sh +Then you can create an conda virtual environment using the script: + +```bash +conda create -n py37 python=3.7 ``` +Activate the conda virtual environment: + +```bash +conda activate py37 +``` + +Intall the conda dependencies + +```bash +conda install -c conda-forge sox libsndfile swig bzip2 gcc_linux-64=8.4.0 gxx_linux-64=8.4.0 --yes +``` + +### Install PaddlePaddle + +For example, for CUDA 10.2, CuDNN7.5 install paddle 2.2.0: + +```bash +python3 -m pip install paddlepaddle-gpu==2.2.0 +``` + +### Install the PaddleSpeech Using PiP + +To Install the PaddleSpeech, there are two methods. You can use the script below: + +```bash +pip install paddlespeech +``` + +If you install the paddlespeech by pip, you can use it to help you to build your own model. However, you can not use the ready-made examples in paddlespeech. + +If you want to use the ready-made examples in paddlespeech, you need to clone the repository and install the paddlespeech package. + +```bash +https://github.com/PaddlePaddle/PaddleSpeech.git +## Into the PaddleSpeech +cd PaddleSpeech +pip install . +``` -## Setup (Other Platform) -- Make sure these libraries or tools in [dependencies](./dependencies.md) installed. More information please see: `setup.py `and ` tools/Makefile`. -- The version of `swig` should >= 3.0 -- we will do more to simplify the install process. -## Running in Docker Container (optional) +## Hard: Get the Full Funciton on Your Mechine + +### Prerequisites + +- choice 1: working with `ubuntu` Docker Container. + + or + +- choice 2: working on `Ubuntu` with `root` privilege. + +To avoid the trouble of environment setup, [running in Docker container](#running-in-docker-container) is highly recommended. Otherwise If you work on `Ubuntu` with `root` privilege, you can skip the next step. + +### Choice 1: Running in Docker Container (Recommand) Docker is an open source tool to build, ship, and run distributed applications in an isolated environment. A Docker image for this project has been provided in [hub.docker.com](https://hub.docker.com) with all the dependencies installed. This Docker image requires the support of NVIDIA GPU, so please make sure its availiability and the [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) has been installed. @@ -46,35 +105,87 @@ Take several steps to launch the Docker image: - Download the Docker image -For example, pull paddle 2.0.0 image: +For example, pull paddle 2.2.0 image: ```bash -nvidia-docker pull registry.baidubce.com/paddlepaddle/paddle:2.0.0-gpu-cuda10.1-cudnn7 +nvidia-docker pull registry.baidubce.com/paddlepaddle/paddle:2.2.0-gpu-cuda10.2-cudnn7 ``` - Clone this repository ``` -git clone https://github.com/PaddlePaddle/DeepSpeech.git +git clone https://github.com/PaddlePaddle/PaddleSpeech.git ``` - Run the Docker image ```bash -sudo nvidia-docker run --rm -it -v $(pwd)/DeepSpeech:/DeepSpeech registry.baidubce.com/paddlepaddle/paddle:2.0.0-gpu-cuda10.1-cudnn7 /bin/bash +sudo nvidia-docker run --net=host --ipc=host --rm -it -v $(pwd)/PaddleSpeech:/PaddleSpeech registry.baidubce.com/paddlepaddle/paddle:2.2.0-gpu-cuda10.2-cudnn7 /bin/bash ``` Now you can execute training, inference and hyper-parameters tuning in the Docker container. +### Choice 2: Running in Ubuntu with Root Privilege + +- Clone this repository + +``` +git clone https://github.com/PaddlePaddle/PaddleSpeech.git +``` + +Install paddle 2.2.0: + +```bash +python3 -m pip install paddlepaddle-gpu==2.2.0 +``` + + +### Install the Conda + +```bash +# download and install the miniconda +pushd tools +bash extras/install_miniconda.sh +popd +# use the "bash" command to make the conda environment works +bash +# create an conda virtual environment +conda create -n py37 python=3.7 +# Activate the conda virtual environment: +conda activate py37 +# Install the conda packags +conda install -c conda-forge sox libsndfile swig bzip2 gcc_linux-64=8.4.0 gxx_linux-64=8.4.0 --yes +``` + +### Install PaddlePaddle + +For example, for CUDA 10.2, CuDNN7.5 install paddle 2.2.0: + +```bash +python3 -m pip install paddlepaddle-gpu==2.2.0 +``` + +### Get the Funcition for Developing PaddleSpeech -- Install PaddlePaddle +```bash +pip install -e .[develop] +``` -For example, for CUDA 10.1, CuDNN7.5 install paddle 2.0.0: +### Install the Kaldi (Optional) ```bash -python3 -m pip install paddlepaddle-gpu==2.0.0 +pushd tools +bash extras/install_openblas.sh +bash extras/install_kaldi.sh +popd ``` -- Install Deepspeech -Please see [Setup](#setup) section. + + +## Setup for Other Platform + +- Make sure these libraries or tools in [dependencies](./dependencies.md) installed. More information please see: `setup.py `and ` tools/Makefile`. +- The version of `swig` should >= 3.0 +- we will do more to simplify the install process. +- Install Paddlespeech \ No newline at end of file diff --git a/docs/tutorial/tts/tts_tutorial.ipynb b/docs/tutorial/tts/tts_tutorial.ipynb index 587924cda..2bb407beb 100644 --- a/docs/tutorial/tts/tts_tutorial.ipynb +++ b/docs/tutorial/tts/tts_tutorial.ipynb @@ -252,7 +252,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 25, "metadata": { "scrolled": true }, @@ -261,8 +261,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "The autoreload extension is already loaded. To reload it, use:\n", - " %reload_ext autoreload\n" + "env: CUDA_VISIBLE_DEVICES=0\n" ] } ], @@ -284,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 28, "metadata": { "scrolled": true }, @@ -317,7 +316,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 30, "metadata": { "scrolled": true }, @@ -596,11 +595,19 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 31, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Frontend done!\n" + ] + } + ], "source": [ "# 传入 phones_dict 会把相应的 phones 转换成 phone_ids\n", "frontend = Frontend(phone_vocab_path=phones_dict)\n", @@ -619,25 +626,11 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 35, "metadata": { "scrolled": true }, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Building prefix dict from the default dictionary ...\n", - "DEBUG:jieba:Building prefix dict from the default dictionary ...\n", - "Loading model from cache /tmp/jieba.cache\n", - "DEBUG:jieba:Loading model from cache /tmp/jieba.cache\n", - "Loading model cost 5.331 seconds.\n", - "DEBUG:jieba:Loading model cost 5.331 seconds.\n", - "Prefix dict has been built successfully.\n", - "DEBUG:jieba:Prefix dict has been built successfully.\n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -701,8 +694,10 @@ "

\n", "在本教程中,我们使用 `FastSpeech2` 作为声学模型。\n", "![FastSpeech2](source/fastspeech2.png)\n", + "\n", "PaddleSpeech TTS 实现的 FastSpeech2 与论文不同的地方在于,我们使用的的是 phone 级别的 `pitch` 和 `energy`(与 FastPitch 类似)。\n", "![FastPitch](source/fastpitch.png)\n", + "\n", "更多关于[声学模型的发展及改进](https://paddlespeech.readthedocs.io/en/latest/tts/models_introduction.html)。" ] }, @@ -1020,13 +1015,16 @@ "odim = fastspeech2_config.n_mels\n", "model = FastSpeech2(\n", " idim=vocab_size, odim=odim, **fastspeech2_config[\"model\"])\n", - "\n", - "model.set_state_dict(paddle.load(fastspeech2_checkpoint)[\"main_params\"]) # 加载预训练模型参数\n", - "model.eval() # 推理阶段不启用 batch norm 和 dropout\n", + "# 加载预训练模型参数\n", + "model.set_state_dict(paddle.load(fastspeech2_checkpoint)[\"main_params\"])\n", + "# 推理阶段不启用 batch norm 和 dropout\n", + "model.eval()\n", "stat = np.load(fastspeech2_stat)\n", - "mu, std = stat # 读取数据预处理阶段数据集的均值和标准差\n", + "# 读取数据预处理阶段数据集的均值和标准差\n", + "mu, std = stat\n", "mu, std = paddle.to_tensor(mu), paddle.to_tensor(std)\n", - "fastspeech2_normalizer = ZScore(mu, std) # 构造归一化的新模型\n", + "# 构造归一化的新模型\n", + "fastspeech2_normalizer = ZScore(mu, std)\n", "fastspeech2_inference = FastSpeech2Inference(fastspeech2_normalizer, model)\n", "fastspeech2_inference.eval()\n", "print(fastspeech2_inference)\n", @@ -1153,16 +1151,18 @@ ], "source": [ "vocoder = PWGGenerator(**pwg_config[\"generator_params\"])\n", - "\n", - "vocoder.set_state_dict(paddle.load(pwg_checkpoint)[\"generator_params\"]) # 模型加载预训练参数\n", + "# 模型加载预训练参数\n", + "vocoder.set_state_dict(paddle.load(pwg_checkpoint)[\"generator_params\"]) \n", "vocoder.remove_weight_norm()\n", - "vocoder.eval() # 推理阶段不启用 batch norm 和 dropout\n", - "\n", - "stat = np.load(pwg_stat) # 读取数据预处理阶段数据集的均值和标准差\n", + "# 推理阶段不启用 batch norm 和 dropout\n", + "vocoder.eval()\n", + "# 读取数据预处理阶段数据集的均值和标准差\n", + "stat = np.load(pwg_stat)\n", "mu, std = stat\n", "mu, std = paddle.to_tensor(mu), paddle.to_tensor(std)\n", "pwg_normalizer = ZScore(mu, std)\n", - "pwg_inference = PWGInference(pwg_normalizer, vocoder) # 构建归一化的模型\n", + "# 构建归一化的模型\n", + "pwg_inference = PWGInference(pwg_normalizer, vocoder)\n", "pwg_inference.eval()\n", "print(\"Parallel WaveGAN done!\")" ] @@ -1266,7 +1266,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 36, "metadata": {}, "outputs": [ { diff --git a/examples/aishell/asr1/READEME.md b/examples/aishell/asr1/READEME.md index e9fd3017c..2eea233da 100644 --- a/examples/aishell/asr1/READEME.md +++ b/examples/aishell/asr1/READEME.md @@ -339,6 +339,3 @@ You need to prepare an audio file, please confirm the sample rate of the audio i ```bash CUDA_VISIBLE_DEVICES= ./local/test_hub.sh conf/transformer.yaml exp/transformer/checkpoints/avg_20 data/test_audio.wav ``` - - - diff --git a/examples/aishell3/vc1/README.md b/examples/aishell3/vc1/README.md index 974b84cad..676678c99 100644 --- a/examples/aishell3/vc1/README.md +++ b/examples/aishell3/vc1/README.md @@ -21,7 +21,7 @@ We use [MFA2.x](https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner) You can download from here [aishell3_alignment_tone.tar.gz](https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/aishell3_alignment_tone.tar.gz), or train your own MFA model reference to [mfa example](https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/examples/other/mfa) (use MFA1.x now) of our repo. ## Pretrained GE2E Model -We use pretrained GE2E model to generate spwaker embedding for each sentence. +We use pretrained GE2E model to generate speaker embedding for each sentence. Download pretrained GE2E model from here [ge2e_ckpt_0.3.zip](https://bj.bcebos.com/paddlespeech/Parakeet/released_models/ge2e/ge2e_ckpt_0.3.zip), and `unzip` it. diff --git a/examples/csmsc/voc3/conf/default.yaml b/examples/csmsc/voc3/conf/default.yaml index 1275f9954..e66d98a63 100644 --- a/examples/csmsc/voc3/conf/default.yaml +++ b/examples/csmsc/voc3/conf/default.yaml @@ -135,4 +135,4 @@ eval_interval_steps: 1000 # Interval steps to evaluate the network # OTHER SETTING # ########################################################### num_snapshots: 10 # max number of snapshots to keep while training -seed: 42 # random seed for paddle, random, and np.random \ No newline at end of file +seed: 42 # random seed for paddle, random, and np.random diff --git a/examples/librispeech/asr1/RESULTS.md b/examples/librispeech/asr1/RESULTS.md index 3dad7acbd..a5257c9d4 100644 --- a/examples/librispeech/asr1/RESULTS.md +++ b/examples/librispeech/asr1/RESULTS.md @@ -21,7 +21,7 @@ ## Transformer | Model | Params | Config | Augmentation| Test set | Decode method | Loss | WER | | --- | --- | --- | --- | --- | --- | --- | --- | -| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention | 6.725063021977743 | 0.047417 | -| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_greedy_search | 6.725063021977743 | 0.053922 | -| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_prefix_beam_search | 6.725063021977743 | 0.053180 | -| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention_rescoring | 6.725063021977743 | 0.041026 | +| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention | 6.484564081827799 | 0.044355 | +| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_greedy_search | 6.484564081827799 | 0.050479 | +| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_prefix_beam_search | 6.484564081827799 | 0.049890 | +| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention_rescoring | 6.484564081827799 | 0.039200 | \ No newline at end of file diff --git a/examples/librispeech/asr1/conf/transformer.yaml b/examples/librispeech/asr1/conf/transformer.yaml index 1806f3fd6..0cc0dae63 100644 --- a/examples/librispeech/asr1/conf/transformer.yaml +++ b/examples/librispeech/asr1/conf/transformer.yaml @@ -1,3 +1,40 @@ +# network architecture +model: + cmvn_file: + cmvn_file_type: "json" + # encoder related + encoder: transformer + encoder_conf: + output_size: 256 # dimension of attention + attention_heads: 4 + linear_units: 2048 # the number of units of position-wise feed forward + num_blocks: 12 # the number of encoder blocks + dropout_rate: 0.1 + positional_dropout_rate: 0.1 + attention_dropout_rate: 0.0 + input_layer: conv2d # encoder input type, you can chose conv2d, conv2d6 and conv2d8 + normalize_before: true + + # decoder related + decoder: transformer + decoder_conf: + attention_heads: 4 + linear_units: 2048 + num_blocks: 6 + dropout_rate: 0.1 + positional_dropout_rate: 0.1 + self_attention_dropout_rate: 0.0 + src_attention_dropout_rate: 0.0 + + # hybrid CTC/attention + model_conf: + ctc_weight: 0.3 + ctc_dropoutrate: 0.0 + ctc_grad_norm_type: null + lsm_weight: 0.1 # label smoothing option + length_normalized_loss: false + + # https://yaml.org/type/float.html data: train_manifest: data/manifest.train @@ -36,43 +73,6 @@ collator: num_workers: 2 -# network architecture -model: - cmvn_file: - cmvn_file_type: "json" - # encoder related - encoder: transformer - encoder_conf: - output_size: 256 # dimension of attention - attention_heads: 4 - linear_units: 2048 # the number of units of position-wise feed forward - num_blocks: 12 # the number of encoder blocks - dropout_rate: 0.1 - positional_dropout_rate: 0.1 - attention_dropout_rate: 0.0 - input_layer: conv2d # encoder input type, you can chose conv2d, conv2d6 and conv2d8 - normalize_before: true - - # decoder related - decoder: transformer - decoder_conf: - attention_heads: 4 - linear_units: 2048 - num_blocks: 6 - dropout_rate: 0.1 - positional_dropout_rate: 0.1 - self_attention_dropout_rate: 0.0 - src_attention_dropout_rate: 0.0 - - # hybrid CTC/attention - model_conf: - ctc_weight: 0.3 - ctc_dropoutrate: 0.0 - ctc_grad_norm_type: null - lsm_weight: 0.1 # label smoothing option - length_normalized_loss: false - - training: n_epoch: 120 accum_grad: 4 diff --git a/examples/librispeech/asr2/RESULTS.md b/examples/librispeech/asr2/RESULTS.md index 41655565d..4cb2d2872 100644 --- a/examples/librispeech/asr2/RESULTS.md +++ b/examples/librispeech/asr2/RESULTS.md @@ -3,9 +3,9 @@ ## Transformer -| Model | Params | GPUS | Averaged Model | Config | Augmentation| Loss | -| --- | --- | --- | --- | --- | --- | -| transformer | 32.52 M | 8 Tesla V100-SXM2-32GB | 10-best val_loss | conf/transformer.yaml | spec_aug | 6.3197922706604 | +| Model | Params | GPUS | Averaged Model | Config | Augmentation| Loss | +| :-: | :-: | :------------: | :------------: | :-: | :-: | :-: | +| transformer | 32.52M | 8 Tesla V100-SXM2-32GB | 10-best val_loss | conf/transformer.yaml | spec_aug | 6.3197922706604 | ### Attention Rescore diff --git a/examples/librispeech/asr2/conf/transformer.yaml b/examples/librispeech/asr2/conf/transformer.yaml index 4a50183a9..3e9350abc 100644 --- a/examples/librispeech/asr2/conf/transformer.yaml +++ b/examples/librispeech/asr2/conf/transformer.yaml @@ -31,7 +31,7 @@ model: model_conf: ctc_weight: 0.3 ctc_dropoutrate: 0.0 - ctc_grad_norm_type: batch + ctc_grad_norm_type: null lsm_weight: 0.1 # label smoothing option length_normalized_loss: false diff --git a/examples/ted_en_zh/st0/conf/transformer_joint_noam.yaml b/examples/ted_en_zh/st0/conf/transformer_mtl_noam.yaml similarity index 99% rename from examples/ted_en_zh/st0/conf/transformer_joint_noam.yaml rename to examples/ted_en_zh/st0/conf/transformer_mtl_noam.yaml index 8256f7160..7e886cca3 100644 --- a/examples/ted_en_zh/st0/conf/transformer_joint_noam.yaml +++ b/examples/ted_en_zh/st0/conf/transformer_mtl_noam.yaml @@ -86,7 +86,7 @@ training: scheduler_conf: warmup_steps: 25000 lr_decay: 1.0 - log_interval: 5 + log_interval: 50 checkpoint: kbest_n: 50 latest_n: 5 diff --git a/examples/ted_en_zh/st0/local/data.sh b/examples/ted_en_zh/st0/local/data.sh index 097cd3a85..c4de1749e 100755 --- a/examples/ted_en_zh/st0/local/data.sh +++ b/examples/ted_en_zh/st0/local/data.sh @@ -42,7 +42,7 @@ if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then # generate manifests python3 ${TARGET_DIR}/ted_en_zh/ted_en_zh.py \ --manifest_prefix="data/manifest" \ - --src_dir="${data_dir}" + --src-dir="${data_dir}" echo "Complete raw data pre-process." fi @@ -76,8 +76,9 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then --spm_vocab_size=${nbpe} \ --spm_mode ${bpemode} \ --spm_model_prefix ${bpeprefix} \ + --spm_character_coverage 1. \ --vocab_path="${dict_dir}/vocab.txt" \ - --text_keys 'text' 'text1' \ + --text_keys 'text' \ --manifest_paths="data/manifest.train.raw" if [ $? -ne 0 ]; then diff --git a/examples/ted_en_zh/st0/run.sh b/examples/ted_en_zh/st0/run.sh index fb4bc3388..bc5ee4e60 100755 --- a/examples/ted_en_zh/st0/run.sh +++ b/examples/ted_en_zh/st0/run.sh @@ -5,7 +5,7 @@ source path.sh gpus=0,1,2,3 stage=0 stop_stage=100 -conf_path=conf/transformer_joint_noam.yaml +conf_path=conf/transformer_mtl_noam.yaml avg_num=5 data_path=./TED_EnZh # path to unzipped data source ${MAIN_ROOT}/utils/parse_options.sh || exit 1; diff --git a/examples/ted_en_zh/st1/cmd.sh b/examples/ted_en_zh/st1/cmd.sh new file mode 100644 index 000000000..7b70ef5e0 --- /dev/null +++ b/examples/ted_en_zh/st1/cmd.sh @@ -0,0 +1,89 @@ +# ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ====== +# Usage: .pl [options] JOB=1: +# e.g. +# run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB +# +# Options: +# --time