Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #1985

Closed
wants to merge 22 commits into from
2 changes: 1 addition & 1 deletion examples/aishell/s0/conf/train_conformer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion examples/aishell/s0/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash /usr/bin/python

# Copyright 2019 Mobvoi Inc. All Rights Reserved.
. ./path.sh || exit 1;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/bin/websocket_client_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 7 additions & 1 deletion runtime/web/streaming_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/compute_cmvn_stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python
# encoding: utf-8

import sys
Expand Down
Loading