Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
86df36a1
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
86df36a1
编写于
10月 20, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tools make
上级
ba28c92b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
66 addition
and
10 deletion
+66
-10
requirements.txt
requirements.txt
+1
-1
setup.py
setup.py
+47
-8
tools/Makefile
tools/Makefile
+1
-1
tools/extras/install_autolog.sh
tools/extras/install_autolog.sh
+17
-0
未找到文件。
requirements.txt
浏览文件 @
86df36a1
setup.py
浏览文件 @
86df36a1
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
import
io
import
io
import
os
import
os
import
re
import
re
from
pathlib
import
Path
import
contextlib
import
inspect
from
setuptools
import
find_packages
from
setuptools
import
find_packages
from
setuptools
import
setup
from
setuptools
import
setup
...
@@ -22,7 +25,7 @@ from setuptools.command.develop import develop
...
@@ -22,7 +25,7 @@ from setuptools.command.develop import develop
from
setuptools.command.install
import
install
from
setuptools.command.install
import
install
import
subprocess
as
sp
import
subprocess
as
sp
HERE
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
HERE
=
Path
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)
))
def
read
(
*
names
,
**
kwargs
):
def
read
(
*
names
,
**
kwargs
):
...
@@ -36,16 +39,52 @@ long_description = read("README.md")
...
@@ -36,16 +39,52 @@ long_description = read("README.md")
deps
=
[
d
.
strip
()
for
d
in
read
(
'requirements.txt'
).
split
()]
deps
=
[
d
.
strip
()
for
d
in
read
(
'requirements.txt'
).
split
()]
@
contextlib
.
contextmanager
def
pushd
(
new_dir
):
old_dir
=
os
.
getcwd
()
os
.
chdir
(
new_dir
)
try
:
yield
finally
:
os
.
chdir
(
old_dir
)
def
check_call
(
cmd
:
str
,
shell
=
False
,
executable
=
None
):
try
:
sp
.
check_call
(
cmd
.
split
(),
shell
=
shell
,
executable
=
"/bin/bash"
if
shell
else
executable
)
except
sp
.
CalledProcessError
as
e
:
print
(
f
"
{
__file__
}
:
{
inspect
.
currentframe
().
f_lineno
}
: CMD:
{
cmd
}
, Error:"
,
e
.
output
,
file
=
sys
.
stderr
)
def
_pre_install
():
def
_pre_install
():
sp
.
check_call
(
"apt-get update -y"
.
split
())
# apt
sp
.
check_call
(
"apt-get install -y"
.
split
()
+
check_call
(
"apt-get update -y"
)
'vim tig tree sox pkg-config'
.
split
()
+
check_call
(
"apt-get install -y "
+
'vim tig tree sox pkg-config '
+
'libsndfile1 libflac-dev libogg-dev'
.
split
()
+
'libsndfile1 libflac-dev libogg-dev '
+
'libvorbis-dev libboost-dev swig python3-dev'
.
split
())
'libvorbis-dev libboost-dev swig python3-dev '
)
# tools/make
tool_dir
=
HERE
/
"tools"
for
f
in
tool_dir
.
glob
(
"*.done"
):
f
.
unlink
()
with
pushd
(
tool_dir
):
check_call
(
"make"
,
True
)
def
_post_install
(
install_lib_dir
):
def
_post_install
(
install_lib_dir
):
pass
# ctcdecoder
check_call
(
"pushd deepspeech/decoders/ctcdecoder/swig && bash setup.sh && popd"
)
# install third_party
check_call
(
"pushd third_party && bash install.sh && popd"
)
# install autolog
check_call
(
"pushd tools/extras && bash install_autolog.sh && popd"
)
class
DevelopCommand
(
develop
):
class
DevelopCommand
(
develop
):
...
@@ -76,7 +115,7 @@ class UploadCommand(Command):
...
@@ -76,7 +115,7 @@ class UploadCommand(Command):
def
run
(
self
):
def
run
(
self
):
try
:
try
:
print
(
"Removing previous dist/ ..."
)
print
(
"Removing previous dist/ ..."
)
shutil
.
rmtree
(
os
.
path
.
join
(
HERE
,
"dist"
))
shutil
.
rmtree
(
str
(
HERE
/
"dist"
))
except
OSError
:
except
OSError
:
pass
pass
print
(
"Building source distribution..."
)
print
(
"Building source distribution..."
)
...
...
tools/Makefile
浏览文件 @
86df36a1
...
@@ -24,7 +24,7 @@ clean:
...
@@ -24,7 +24,7 @@ clean:
kenlm.done
:
kenlm.done
:
# Ubuntu 16.04 透過 apt 會安裝 boost 1.58.0
# Ubuntu 16.04 透過 apt 會安裝 boost 1.58.0
# it seems that boost
(
1.54.0
)
requires higher version. After I switched to g++-5 it compiles normally.
# it seems that boost
(
1.54.0
)
requires higher version. After I switched to g++-5 it compiles normally.
apt
install
-y
build-essential cmake libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libeigen3-dev zlib1g-dev libbz2-dev liblzma-dev
apt
install
-y
--allow-unauthenticated
build-essential cmake libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libeigen3-dev zlib1g-dev libbz2-dev liblzma-dev
apt-get
install
-y
gcc-5 g++-5
&&
update-alternatives
--install
/usr/bin/gcc gcc /usr/bin/gcc-5 50
&&
update-alternatives
--install
/usr/bin/g++ g++ /usr/bin/g++-5 50
apt-get
install
-y
gcc-5 g++-5
&&
update-alternatives
--install
/usr/bin/gcc gcc /usr/bin/gcc-5 50
&&
update-alternatives
--install
/usr/bin/g++ g++ /usr/bin/g++-5 50
test
-d
kenlm
||
wget
-O
- https://kheafield.com/code/kenlm.tar.gz
--no-check-certificate
|
tar
xz
test
-d
kenlm
||
wget
-O
- https://kheafield.com/code/kenlm.tar.gz
--no-check-certificate
|
tar
xz
rm
-rf
kenlm/build
&&
mkdir
-p
kenlm/build
&&
cd
kenlm/build
&&
cmake ..
&&
make
-j4
&&
make
install
rm
-rf
kenlm/build
&&
mkdir
-p
kenlm/build
&&
cd
kenlm/build
&&
cmake ..
&&
make
-j4
&&
make
install
...
...
tools/extras/install_autolog.sh
0 → 100644
浏览文件 @
86df36a1
#!/bin/bash
#install auto-log
python
-c
"import auto_log"
if
[
$?
!=
0
]
;
then
info_msg
"Install auto_log into default system path"
test
-d
AutoLog
||
git clone https://github.com/LDOUBLEV/AutoLog
if
[
$?
!=
0
]
;
then
error_msg
"Download auto_log failed !!!"
exit
1
fi
cd
AutoLog
pip
install
-r
requirements.txt
python setup.py
install
cd
..
rm
-rf
AutoLog
fi
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录