From 17a67fe579f59b7e1275571cd0e19a0984beaf2e Mon Sep 17 00:00:00 2001 From: blessyyyu <954793264@qq.com> Date: Wed, 23 Mar 2022 14:04:00 +0800 Subject: [PATCH] updated lint error --- .gitattributes | 1 - examples/hi_xiaowen/s0/run.sh | 9 +++++---- kws/bin/compute_det_longwav.py | 7 ++++--- kws/bin/score_longwav.py | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 0832a4d..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -./examples/hi_xiaowen/s0/run.sh filter=gitignore \ No newline at end of file diff --git a/examples/hi_xiaowen/s0/run.sh b/examples/hi_xiaowen/s0/run.sh index 32b3257..814474a 100755 --- a/examples/hi_xiaowen/s0/run.sh +++ b/examples/hi_xiaowen/s0/run.sh @@ -3,21 +3,22 @@ . ./path.sh -stage=3 -stop_stage=3 +stage=0 +stop_stage=4 num_keywords=2 -config=conf/tcn.yaml +config=conf/ds_tcn.yaml norm_mean=true norm_var=true gpus="0,1" +checkpoint= dir=exp/ds_tcn num_average=30 -checkpoint= score_checkpoint=$dir/avg_${num_average}.pt +download_dir=./mobvoi_data . tools/parse_options.sh || exit 1; diff --git a/kws/bin/compute_det_longwav.py b/kws/bin/compute_det_longwav.py index 02c827e..e7983c7 100644 --- a/kws/bin/compute_det_longwav.py +++ b/kws/bin/compute_det_longwav.py @@ -1,4 +1,5 @@ # Copyright (c) 2021 Binbin Zhang(binbzha@qq.com) +# 2022 Shaoqing Yu(yu954793264@163.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,8 +25,8 @@ def load_label_and_score(keyword, label_file, score_file): arr = line.strip().split() # key = utt_id key = arr[0] - # scores is a list - str_list = arr[1: ] + # scores is a list + str_list = arr[1:] scores = list(map(float, str_list)) score_table[key] = scores keyword_table = {} @@ -43,7 +44,7 @@ def load_label_and_score(keyword, label_file, score_file): index = obj['txt'] duration = obj['duration'] assert key in score_table - # txt == keyword , correct + # txt == keyword , correct if index == keyword: keyword_table[key] = score_table[key] else: diff --git a/kws/bin/score_longwav.py b/kws/bin/score_longwav.py index cfb6ae9..05495d2 100644 --- a/kws/bin/score_longwav.py +++ b/kws/bin/score_longwav.py @@ -1,4 +1,5 @@ # Copyright (c) 2021 Binbin Zhang(binbzha@qq.com) +# 2022 Shaoqing Yu(yu954793264@163.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +28,6 @@ from torch.utils.data import DataLoader from kws.dataset.dataset import Dataset from kws.model.kws_model import init_model from kws.utils.checkpoint import load_checkpoint -from kws.utils.mask import padding_mask def get_args(): @@ -60,7 +60,7 @@ def get_args(): help='output score file') parser.add_argument('--num_keywords', required=True, - help='the number of keywords') + help='the number of keywords') parser.add_argument('--jit_model', action='store_true', default=False,