Commit c4f60362 by xuchen

Modify the egs scripts

parent f006cf77
#! /bin/bash #! /bin/bash
# training the model
gpu_num=1 gpu_num=1
test_subset=(test-clean test-other) test_subset=(test-clean test-other)
exp_name=test
exp_name=
if [ "$#" -eq 1 ]; then
exp_name=$1
fi
n_average=10 n_average=10
beam_size=5 beam_size=5
......
...@@ -204,13 +204,23 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then ...@@ -204,13 +204,23 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
dec_model=checkpoint_best.pt dec_model=checkpoint_best.pt
fi fi
if [[ -z ${device} || ${#device[@]} -eq 0 ]]; then
if [[ ${gpu_num} -eq 0 ]]; then
device=()
else
source ./local/utils.sh
device=$(get_devices $gpu_num 0)
fi
fi
export CUDA_VISIBLE_DEVICES=${device}
#tmp_file=$(mktemp ${model_dir}/tmp-XXXXX) #tmp_file=$(mktemp ${model_dir}/tmp-XXXXX)
#trap 'rm -rf ${tmp_file}' EXIT #trap 'rm -rf ${tmp_file}' EXIT
result_file=${model_dir}/decode_result result_file=${model_dir}/decode_result
[[ -f ${result_file} ]] && rm ${result_file} [[ -f ${result_file} ]] && rm ${result_file}
for subset in ${test_subset[@]}; do for subset in ${test_subset[@]}; do
subset=${subset}_asr subset=${subset}
cmd="python ${root_dir}/fairseq_cli/generate.py cmd="python ${root_dir}/fairseq_cli/generate.py
${data_dir}/$lang ${data_dir}/$lang
--config-yaml ${data_config} --config-yaml ${data_config}
......
#! /bin/bash #! /bin/bash
# training the model
gpu_num=1 gpu_num=1
test_subset=(tst-COMMON) test_subset=(tst-COMMON)
exp_name=test
exp_name=
if [ "$#" -eq 1 ]; then
exp_name=$1
fi
n_average=10 n_average=10
beam_size=5 beam_size=5
max_tokens=40000 max_tokens=40000
cmd="./run.sh cmd="./run.sh
--stage 3 --stage 2
--stop_stage 3 --stop_stage 2
--gpu_num ${gpu_num} --gpu_num ${gpu_num}
--exp_name ${exp_name} --exp_name ${exp_name}
--test_subset ${test_subset} --test_subset ${test_subset}
......
...@@ -205,6 +205,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then ...@@ -205,6 +205,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
dec_model=checkpoint_best.pt dec_model=checkpoint_best.pt
fi fi
if [[ -z ${device} || ${#device[@]} -eq 0 ]]; then
if [[ ${gpu_num} -eq 0 ]]; then
device=()
else
source ./local/utils.sh
device=$(get_devices $gpu_num 0)
fi
fi
export CUDA_VISIBLE_DEVICES=${device}
#tmp_file=$(mktemp ${model_dir}/tmp-XXXXX) #tmp_file=$(mktemp ${model_dir}/tmp-XXXXX)
#trap 'rm -rf ${tmp_file}' EXIT #trap 'rm -rf ${tmp_file}' EXIT
result_file=${model_dir}/decode_result result_file=${model_dir}/decode_result
...@@ -221,7 +231,11 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then ...@@ -221,7 +231,11 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
--results-path ${model_dir} --results-path ${model_dir}
--max-tokens ${max_tokens} --max-tokens ${max_tokens}
--beam ${beam_size} --beam ${beam_size}
--scoring wer" --scoring wer
--wer-tokenizer 13a
--wer-lowercase
--wer-remove-punct
"
echo -e "\033[34mRun command: \n${cmd} \033[0m" echo -e "\033[34mRun command: \n${cmd} \033[0m"
if [[ $eval -eq 1 ]]; then if [[ $eval -eq 1 ]]; then
......
#! /bin/bash #! /bin/bash
# training the model
gpu_num=1 gpu_num=1
test_subset=(tst-COMMON) test_subset=(tst-COMMON)
exp_name=test
exp_name=
if [ "$#" -eq 1 ]; then
exp_name=$1
fi
n_average=10 n_average=10
beam_size=5 beam_size=5
......
...@@ -242,6 +242,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then ...@@ -242,6 +242,16 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
dec_model=checkpoint_best.pt dec_model=checkpoint_best.pt
fi fi
if [[ -z ${device} || ${#device[@]} -eq 0 ]]; then
if [[ ${gpu_num} -eq 0 ]]; then
device=()
else
source ./local/utils.sh
device=$(get_devices $gpu_num 0)
fi
fi
export CUDA_VISIBLE_DEVICES=${device}
#tmp_file=$(mktemp ${model_dir}/tmp-XXXXX) #tmp_file=$(mktemp ${model_dir}/tmp-XXXXX)
#trap 'rm -rf ${tmp_file}' EXIT #trap 'rm -rf ${tmp_file}' EXIT
result_file=${model_dir}/decode_result result_file=${model_dir}/decode_result
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论