mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-09 17:14:20 +00:00
example usage
This commit is contained in:
parent
14a4d1d6f2
commit
d9a6aff863
@ -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
|
stage=$1
|
||||||
|
|
||||||
|
# Set the GPUs available.
|
||||||
|
# This script requires at least one GPU.
|
||||||
|
# Example:
|
||||||
export CUDA_VISIBLE_DEVICES="2,3,4,5"
|
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
|
hubert_model=${hubert_model_dir}/${model_id}.pt
|
||||||
mkdir -p ${hubert_model_dir}
|
mkdir -p ${hubert_model_dir}
|
||||||
# For more models refer to: https://github.com/pytorch/fairseq/tree/main/examples/hubert
|
# 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}
|
if [ -f ${hubert_model} ]; then
|
||||||
wget -c wget https://dl.fbaipublicfiles.com/fairseq/wav2vec/dict.ltr.txt -P ${hubert_model_dir}
|
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
|
fi
|
||||||
|
|
||||||
if [ ! -d ./data/fbank ]; then
|
if [ ! -d ./data/fbank ]; then
|
||||||
echo "This script assumes ./data/fbank is already generated by prepare.sh"
|
echo "This script assumes ./data/fbank is already generated by prepare.sh"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $stage -eq 1 ]; then
|
if [ $stage -eq 1 ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user