Skip to content

Commit

Permalink
remove double blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
linrrry committed Jul 4, 2024
1 parent c953412 commit a86d300
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions wenet/bin/recognize_onnx_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
'https://github.com/Slyne/ctc_decoder.git')
sys.exit(1)


def get_args():
parser = argparse.ArgumentParser(description='recognize with your model')
parser.add_argument('--config', required=True, help='config file')
Expand Down Expand Up @@ -105,11 +104,9 @@ def get_args():
parser.add_argument('--fp16',
action='store_true',
help='whether to export fp16 model, default false')
args = parser.parse_args()
print(args)
args = parser.parse_args()
return args


def main():
args = get_args()
logging.basicConfig(level=logging.DEBUG,
Expand Down Expand Up @@ -140,15 +137,12 @@ def main():
test_conf['batch_conf']['batch_type'] = "static"
test_conf['batch_conf']['batch_size'] = args.batch_size



tokenizer = init_tokenizer(configs)
test_dataset = Dataset(args.data_type,
args.test_data,
tokenizer,
test_conf,
partition=False)

test_data_loader = DataLoader(test_dataset, batch_size=None, num_workers=0)

# Init asr model from configs
Expand All @@ -168,8 +162,6 @@ def main():
# Load dict
vocabulary = []
char_dict = {}


with open(args.dict, 'r') as fin:
for line in fin:
arr = line.strip().split()
Expand Down Expand Up @@ -301,6 +293,5 @@ def main():
logging.info('{} {}'.format(key, content))
fout.write('{} {}\n'.format(key, content))


if __name__ == '__main__':
main()

0 comments on commit a86d300

Please sign in to comment.