feat:add windows ctc-decoders compile func

pull/2165/head
lidongdong 2 years ago
parent b2baf1450a
commit 4c92af5717

@ -13,7 +13,8 @@
#include "decoder_utils.h"
using namespace lm::ngram;
// if your platform is windows ,you need add the define
#define F_OK 0
Scorer::Scorer(double alpha,
double beta,
const std::string& lm_path,

@ -89,10 +89,11 @@ FILES = [
or fn.endswith('unittest.cc'))
]
# yapf: enable
LIBS = ['stdc++']
# LIBS = ['stdc++']
LIBS = ['-static-libstdc++']
if platform.system() != 'Darwin':
LIBS.append('rt')
# LIBS.append('rt')
pass
ARGS = ['-O3', '-DNDEBUG', '-DKENLM_MAX_ORDER=6', '-std=c++11']
@ -126,12 +127,12 @@ decoders_module = [
]
setup(
name='paddlespeech_ctcdecoders',
name='paddlespeech_ldd_ctcdecoders',
version='0.2.0',
description="CTC decoders in paddlespeech",
author="PaddlePaddle Speech and Language Team",
author_email="paddlesl@baidu.com",
author="PaddlePaddle Speech user lidongdong compile for windows",
author_email="double_dongli@foxmail.com",
url="https://github.com/PaddlePaddle/PaddleSpeech",
license='Apache 2.0, GNU Lesser General Public License v3 (LGPLv3) (LGPL-3)',
ext_modules=decoders_module,
py_modules=['paddlespeech_ctcdecoders'])
py_modules=['paddlespeech_ldd_ctcdecoders'])

@ -0,0 +1,24 @@
@echo off
cd ctc_decoders
if not exist kenlm (
git clone https://github.com/Doubledongli/kenlm.git
cd kenlm/
git checkout df2d717e95183f79a90b2fa6e4307083a351ca6a
cd ..
@echo.
)
if not exist openfst-1.6.3 (
echo "Download and extract openfst ..."
git clone https://gitee.com/koala999/openfst.git
ren openfst openfst-1.6.3
@echo.
)
if not exist ThreadPool (
git clone https://github.com/progschj/ThreadPool.git
@echo.
)
echo "Install decoders ..."
python setup.py install --num_processes 4
Loading…
Cancel
Save