Commit 81f56f64 authored by Zhaoheng Ni's avatar Zhaoheng Ni Committed by Facebook GitHub Bot
Browse files

Refactor ArgumentParser arguments in emformer_rnnt recipes (#2236)

Summary:
Replace underscore with dash in ArgumentParser's arguments.

Pull Request resolved: https://github.com/pytorch/audio/pull/2236

Reviewed By: mthrok

Differential Revision: D34266977

Pulled By: nateanl

fbshipit-source-id: ceacac12c04016a8dbf2a1a7d6bbcf65d4d53d21
parent a007e922
...@@ -30,7 +30,7 @@ srun --cpus-per-task=12 --gpus-per-node=8 -N 4 --ntasks-per-node=8 python train. ...@@ -30,7 +30,7 @@ srun --cpus-per-task=12 --gpus-per-node=8 -N 4 --ntasks-per-node=8 python train.
Sample SLURM command for evaluation: Sample SLURM command for evaluation:
``` ```
srun python eval.py --model_type librispeech --checkpoint_path ./experiments/checkpoints/epoch=119-step=208079.ckpt --dataset-path ./datasets/librispeech --sp-model-path ./spm_bpe_4096.model --use-cuda srun python eval.py --model-type librispeech --checkpoint-path ./experiments/checkpoints/epoch=119-step=208079.ckpt --dataset-path ./datasets/librispeech --sp-model-path ./spm_bpe_4096.model --use-cuda
``` ```
The script used for training the SentencePiece model that's referenced by the training command above can be found at [`librispeech/train_spm.py`](./librispeech/train_spm.py); a pretrained SentencePiece model can be downloaded [here](https://download.pytorch.org/torchaudio/pipeline-assets/spm_bpe_4096_librispeech.model). The script used for training the SentencePiece model that's referenced by the training command above can be found at [`librispeech/train_spm.py`](./librispeech/train_spm.py); a pretrained SentencePiece model can be downloaded [here](https://download.pytorch.org/torchaudio/pipeline-assets/spm_bpe_4096_librispeech.model).
......
"""Generate feature statistics for training set. """Generate feature statistics for training set.
Example: Example:
python global_stats.py --model_type librispeech --dataset_path /home/librispeech python global_stats.py --model-type librispeech --dataset-path /home/librispeech
""" """
import json import json
......
...@@ -67,9 +67,9 @@ def run_eval_streaming(args): ...@@ -67,9 +67,9 @@ def run_eval_streaming(args):
def parse_args(): def parse_args():
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument("--model_type", type=str, choices=[MODEL_TYPE_LIBRISPEECH, MODEL_TYPE_TEDLIUM3], required=True) parser.add_argument("--model-type", type=str, choices=[MODEL_TYPE_LIBRISPEECH, MODEL_TYPE_TEDLIUM3], required=True)
parser.add_argument( parser.add_argument(
"--dataset_path", "--dataset-path",
type=pathlib.Path, type=pathlib.Path,
help="Path to dataset.", help="Path to dataset.",
required=True, required=True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment