From d9a6aff8631c5b1573a30d7a8e840182e332e916 Mon Sep 17 00:00:00 2001 From: Guo Liyong Date: Fri, 27 May 2022 10:28:34 +0800 Subject: [PATCH] example usage --- .../ASR/distillation_with_hubert.sh | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/distillation_with_hubert.sh b/egs/librispeech/ASR/distillation_with_hubert.sh index 91392c473..4ac57e3b4 100644 --- a/egs/librispeech/ASR/distillation_with_hubert.sh +++ b/egs/librispeech/ASR/distillation_with_hubert.sh @@ -1,4 +1,15 @@ +# This is an example to do distillation with librispeech clean-100 subset. +# run with command: +# bash distillation_with_hubert.sh [0|1|2|3|4] +# +# For example command +# bash distillation_with_hubert.sh 0 +# will download hubert model. stage=$1 + +# Set the GPUs available. +# This script requires at least one GPU. +# Example: export CUDA_VISIBLE_DEVICES="2,3,4,5" @@ -23,13 +34,17 @@ if [ $stage -eq 0 ]; then hubert_model=${hubert_model_dir}/${model_id}.pt mkdir -p ${hubert_model_dir} # For more models refer to: https://github.com/pytorch/fairseq/tree/main/examples/hubert - wget -c https://dl.fbaipublicfiles.com/hubert/${model_id} -P ${hubert_model_dir} - wget -c wget https://dl.fbaipublicfiles.com/fairseq/wav2vec/dict.ltr.txt -P ${hubert_model_dir} + if [ -f ${hubert_model} ]; then + echo "hubert model alread exists." + else + wget -c https://dl.fbaipublicfiles.com/hubert/${model_id} -P ${hubert_model} + wget -c wget https://dl.fbaipublicfiles.com/fairseq/wav2vec/dict.ltr.txt -P ${hubert_model_dir} + fi fi if [ ! -d ./data/fbank ]; then echo "This script assumes ./data/fbank is already generated by prepare.sh" - exit 0 + exit 1 fi if [ $stage -eq 1 ]; then