diff --git a/examples/aishell/s0/conf/train_conformer.yaml b/examples/aishell/s0/conf/train_conformer.yaml index b8ce511cd..623f261e6 100644 --- a/examples/aishell/s0/conf/train_conformer.yaml +++ b/examples/aishell/s0/conf/train_conformer.yaml @@ -41,7 +41,7 @@ dataset_conf: token_max_length: 200 token_min_length: 1 resample_conf: - resample_rate: 16000 + resample_rate: 8000 speed_perturb: true fbank_conf: num_mel_bins: 80 diff --git a/examples/aishell/s0/run.sh b/examples/aishell/s0/run.sh index d3ff2ddfa..527b55624 100644 --- a/examples/aishell/s0/run.sh +++ b/examples/aishell/s0/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash /usr/bin/python # Copyright 2019 Mobvoi Inc. All Rights Reserved. . ./path.sh || exit 1; @@ -47,6 +47,7 @@ train_set=train train_config=conf/train_conformer.yaml cmvn=true dir=exp/conformer +#checkpoint=exp/conformer/9.pt checkpoint= num_workers=8 prefetch=500 @@ -67,6 +68,7 @@ if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then echo "stage -1: Data Download" local/download_and_untar.sh ${data} ${data_url} data_aishell local/download_and_untar.sh ${data} ${data_url} resource_aishell + readlink -f $(which python) fi if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then @@ -117,6 +119,9 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then done fi +export CUDA_VISIBLE_DEVICES="0,1,2,3,4,5,6,7" +echo $CUDA_VISIBLE_DEVICES + if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then mkdir -p $dir # You have to rm `INIT_FILE` manually when you resume or restart a diff --git a/runtime/core/bin/websocket_client_main.cc b/runtime/core/bin/websocket_client_main.cc index 3eaa96069..d2e3a6150 100644 --- a/runtime/core/bin/websocket_client_main.cc +++ b/runtime/core/bin/websocket_client_main.cc @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) { client.SendStartSignal(); wenet::WavReader wav_reader(FLAGS_wav_path); - const int sample_rate = 16000; + const int sample_rate = 8000; // Only support 16K CHECK_EQ(wav_reader.sample_rate(), sample_rate); const int num_samples = wav_reader.num_samples(); diff --git a/runtime/web/streaming_app.py b/runtime/web/streaming_app.py index 71b0e8943..355221cbd 100644 --- a/runtime/web/streaming_app.py +++ b/runtime/web/streaming_app.py @@ -7,7 +7,13 @@ torch.manual_seed(777) # for lint wenet.set_log_level(2) -decoder = wenet.Decoder(lang='chs') +decoder = wenet.Decoder(lang='chs', + nbest=5, + enable_timestamp=True, + context=['宜享花','榕树','小辉贷'], + context_score=3.0, + model_dir='E:\\wenet\\pretrained\\runtime\\wenetspeech_u2pp_conformer_libtorch\\20220506_u2pp_conformer_libtorch') + # model_dir='E:\\wenet\\pretrained\\runtime\\aishell_u2pp_conformer_libtorch\\aishell_u2pp_conformer_libtorch') def recognition(audio): sr, y = audio diff --git a/tools/compute_cmvn_stats.py b/tools/compute_cmvn_stats.py index 9c89789c4..9d2709883 100755 --- a/tools/compute_cmvn_stats.py +++ b/tools/compute_cmvn_stats.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python # encoding: utf-8 import sys