-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathlaunch.sh
executable file
·75 lines (57 loc) · 1.84 KB
/
launch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
PRED_WAVSCP=$1
GT_WAVSCP=$2
SCORE_DIR=$3
SPLIT_SIZE=$4
GPU_PART=general
CPU_PART=general
mkdir -p ${SCORE_DIR}
mkdir -p ${SCORE_DIR}/pred
mkdir -p ${SCORE_DIR}/gt
mkdir -p ${SCORE_DIR}/result
total_lines=$(wc -l < "${PRED_WAVSCP}")
source_wavscp=$(basename ${PRED_WAVSCP})
lines_per_piece=$(( (total_lines + SPLIT_SIZE) / SPLIT_SIZE ))
split -l ${lines_per_piece} -d -a 3 ${PRED_WAVSCP} ${SCORE_DIR}/pred/${source_wavscp}_
pred_list=(${SCORE_DIR}/pred/${source_wavscp}_*)
if [ "${GT_WAVSCP}" = None ]; then
echo "No ground truth audio received, skipping ground truth info"
else
target_wavscp=$(basename ${GT_WAVSCP})
split -l ${lines_per_piece} -d -a 3 ${GT_WAVSCP} ${SCORE_DIR}/gt/${target_wavscp}_
gt_list=(${SCORE_DIR}/gt/${target_wavscp}_*)
if [ ${#pred_list[@]} -ne ${#gt_list[@]} ]; then
echo "The number of split ground truth and predictions does not match."
exit 1
fi
fi
for ((i=0; i<${#pred_list[@]}; i++)) ; do
sub_pred_wavscp=${pred_list[${i}]}
if [ "${GT_WAVSCP}" = None ]; then
sub_gt_wavscp=None
else
sub_gt_wavscp=${gt_list[${i}]}
fi
echo "${sub_pred_wavscp} ${sub_gt_wavscp}"
sbatch \
-p ${GPU_PART} \
--time 2-0:00:00 \
--cpus-per-task 8 \
--mem-per-cpu 2000M \
--gres=gpu:A6000:1 \
./egs/run_gpu.sh \
${sub_pred_wavscp} \
${sub_gt_wavscp} \
${SCORE_DIR}/result/$(basename ${sub_pred_wavscp}).result.gpu.txt \
egs/speech_gpu.yaml
sbatch \
-p ${CPU_PART} \
--time 2-0:00:00 \
--cpus-per-task 8 \
--mem-per-cpu 2000M \
./egs/run_cpu.sh \
${sub_pred_wavscp} \
${sub_gt_wavscp} \
${SCORE_DIR}/result/$(basename ${sub_pred_wavscp}).result.cpu.txt \
egs/speech_cpu.yaml
done