Skip to content

Commit 8d60ee3

Browse files
vimalmanohardanpovey
authored andcommitted
[scripts] Add fix regarding num-jobs for segment_long_utterances*.sh(#3130)
1 parent 1f068cd commit 8d60ee3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

egs/wsj/s5/steps/cleanup/segment_long_utterances.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,17 @@ if [ $stage -le 3 ]; then
174174
cp $srcdir/phones.txt $dir 2>/dev/null || true
175175

176176
mkdir -p $graph_dir
177+
178+
n_reco=$(cat $text | wc -l) || exit 1
179+
nj_reco=$nj
180+
181+
if [ $nj -gt $n_reco ]; then
182+
nj_reco=$n_reco
183+
fi
177184

178185
# Make graphs w.r.t. to the original text (usually recording-level)
179186
steps/cleanup/make_biased_lm_graphs.sh $graph_opts \
180-
--nj $nj --cmd "$cmd" $text \
187+
--nj $nj_reco --cmd "$cmd" $text \
181188
$lang $dir $dir/graphs
182189
if [ -z "$utt2text" ]; then
183190
# and then copy it to the sub-segments.

egs/wsj/s5/steps/cleanup/segment_long_utterances_nnet3.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,17 @@ if [ $stage -le 3 ]; then
235235

236236
mkdir -p $graph_dir
237237

238+
n_reco=$(cat $text | wc -l) || exit 1
239+
nj_reco=$nj
240+
241+
if [ $nj -gt $n_reco ]; then
242+
nj_reco=$n_reco
243+
fi
244+
238245
# Make graphs w.r.t. to the original text (usually recording-level)
239246
steps/cleanup/make_biased_lm_graphs.sh $graph_opts \
240247
--scale-opts "$scale_opts" \
241-
--nj $nj --cmd "$cmd" $text \
248+
--nj $nj_reco --cmd "$cmd" $text \
242249
$lang $dir $dir/graphs
243250
if [ -z "$utt2text" ]; then
244251
# and then copy it to the sub-segments.

0 commit comments

Comments
 (0)