Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
ad3b1abf
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看板
提交
ad3b1abf
编写于
7月 01, 2022
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ext so not in build/lib.xxx
上级
5d34b7f6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
58 addition
and
24 deletion
+58
-24
setup.py
setup.py
+57
-23
tools/setup_helpers/extension.py
tools/setup_helpers/extension.py
+1
-1
未找到文件。
setup.py
浏览文件 @
ad3b1abf
...
@@ -32,19 +32,49 @@ from setuptools.command.test import test
...
@@ -32,19 +32,49 @@ from setuptools.command.test import test
from
tools
import
setup_helpers
from
tools
import
setup_helpers
HERE
=
Path
(
__file__
).
parent
.
resolve
()
ROOT_DIR
=
Path
(
__file__
).
parent
.
resolve
()
VERSION
=
'0.0.0'
VERSION
=
'0.0.0'
COMMITID
=
'none'
COMMITID
=
'none'
base
=
[
base
=
[
"editdistance"
,
"g2p_en"
,
"g2pM"
,
"h5py"
,
"inflect"
,
"jieba"
,
"jsonlines"
,
"editdistance"
,
"kaldiio"
,
"librosa==0.8.1"
,
"loguru"
,
"matplotlib"
,
"nara_wpe"
,
"g2p_en"
,
"onnxruntime"
,
"pandas"
,
"paddlenlp"
,
"paddlespeech_feat"
,
"praatio==5.0.0"
,
"g2pM"
,
"pypinyin"
,
"pypinyin-dict"
,
"python-dateutil"
,
"pyworld"
,
"resampy==0.2.2"
,
"h5py"
,
"sacrebleu"
,
"scipy"
,
"sentencepiece~=0.1.96"
,
"soundfile~=0.10"
,
"inflect"
,
"textgrid"
,
"timer"
,
"tqdm"
,
"typeguard"
,
"visualdl"
,
"webrtcvad"
,
"jieba"
,
"yacs~=0.1.8"
,
"prettytable"
,
"zhon"
,
'colorlog'
,
'pathos == 0.2.8'
"jsonlines"
,
"kaldiio"
,
"librosa==0.8.1"
,
"loguru"
,
"matplotlib"
,
"nara_wpe"
,
"onnxruntime"
,
"pandas"
,
"paddlenlp"
,
"paddlespeech_feat"
,
"praatio==5.0.0"
,
"pypinyin"
,
"pypinyin-dict"
,
"python-dateutil"
,
"pyworld"
,
"resampy==0.2.2"
,
"sacrebleu"
,
"scipy"
,
"sentencepiece~=0.1.96"
,
"soundfile~=0.10"
,
"textgrid"
,
"timer"
,
"tqdm"
,
"typeguard"
,
"visualdl"
,
"webrtcvad"
,
"yacs~=0.1.8"
,
"prettytable"
,
"zhon"
,
"colorlog"
,
"pathos == 0.2.8"
]
]
server
=
[
server
=
[
...
@@ -109,6 +139,13 @@ def check_output(cmd: Union[str, List[str], Tuple[str]], shell=False):
...
@@ -109,6 +139,13 @@ def check_output(cmd: Union[str, List[str], Tuple[str]], shell=False):
return
out_bytes
.
strip
().
decode
(
'utf8'
)
return
out_bytes
.
strip
().
decode
(
'utf8'
)
def
_run_cmd
(
cmd
):
try
:
return
subprocess
.
check_output
(
cmd
,
cwd
=
ROOT_DIR
,
stderr
=
subprocess
.
DEVNULL
).
decode
(
"ascii"
).
strip
()
except
Exception
:
return
None
@
contextlib
.
contextmanager
@
contextlib
.
contextmanager
def
pushd
(
new_dir
):
def
pushd
(
new_dir
):
old_dir
=
os
.
getcwd
()
old_dir
=
os
.
getcwd
()
...
@@ -136,14 +173,14 @@ def _remove(files: str):
...
@@ -136,14 +173,14 @@ def _remove(files: str):
def
_post_install
(
install_lib_dir
):
def
_post_install
(
install_lib_dir
):
# tools/make
# tools/make
tool_dir
=
HERE
/
"tools"
tool_dir
=
ROOT_DIR
/
"tools"
_remove
(
tool_dir
.
glob
(
"*.done"
))
_remove
(
tool_dir
.
glob
(
"*.done"
))
with
pushd
(
tool_dir
):
with
pushd
(
tool_dir
):
check_call
(
"make"
)
check_call
(
"make"
)
print
(
"tools install."
)
print
(
"tools install."
)
# ctcdecoder
# ctcdecoder
ctcdecoder_dir
=
HERE
/
'third_party/ctc_decoders'
ctcdecoder_dir
=
ROOT_DIR
/
'third_party/ctc_decoders'
with
pushd
(
ctcdecoder_dir
):
with
pushd
(
ctcdecoder_dir
):
check_call
(
"bash -e setup.sh"
)
check_call
(
"bash -e setup.sh"
)
print
(
"ctcdecoder install."
)
print
(
"ctcdecoder install."
)
...
@@ -156,10 +193,6 @@ class DevelopCommand(develop):
...
@@ -156,10 +193,6 @@ class DevelopCommand(develop):
self
.
execute
(
_post_install
,
(
self
.
install_lib
,
),
msg
=
"Post Install..."
)
self
.
execute
(
_post_install
,
(
self
.
install_lib
,
),
msg
=
"Post Install..."
)
class
InstallCommand
(
install
):
def
run
(
self
):
install
.
run
(
self
)
class
TestCommand
(
test
):
class
TestCommand
(
test
):
def
finalize_options
(
self
):
def
finalize_options
(
self
):
...
@@ -174,7 +207,7 @@ class TestCommand(test):
...
@@ -174,7 +207,7 @@ class TestCommand(test):
# cmd: python setup.py upload
# cmd: python setup.py upload
class
UploadCommand
(
Command
):
class
UploadCommand
(
distutils
.
cmd
.
Command
):
description
=
"Build and publish the package."
description
=
"Build and publish the package."
user_options
=
[]
user_options
=
[]
...
@@ -187,7 +220,7 @@ class UploadCommand(Command):
...
@@ -187,7 +220,7 @@ class UploadCommand(Command):
def
run
(
self
):
def
run
(
self
):
try
:
try
:
print
(
"Removing previous dist/ ..."
)
print
(
"Removing previous dist/ ..."
)
shutil
.
rmtree
(
str
(
HERE
/
"dist"
))
shutil
.
rmtree
(
str
(
ROOT_DIR
/
"dist"
))
except
OSError
:
except
OSError
:
pass
pass
print
(
"Building source distribution..."
)
print
(
"Building source distribution..."
)
...
@@ -209,7 +242,7 @@ def _get_version(sha):
...
@@ -209,7 +242,7 @@ def _get_version(sha):
def
_make_version_file
(
version
,
sha
):
def
_make_version_file
(
version
,
sha
):
sha
=
"Unknown"
if
sha
is
None
else
sha
sha
=
"Unknown"
if
sha
is
None
else
sha
version_path
=
HERE
/
"paddlespeech"
/
"version.py"
version_path
=
ROOT_DIR
/
"paddlespeech"
/
"version.py"
with
open
(
version_path
,
"w"
)
as
f
:
with
open
(
version_path
,
"w"
)
as
f
:
f
.
write
(
f
"__version__ = '
{
version
}
'
\n
"
)
f
.
write
(
f
"__version__ = '
{
version
}
'
\n
"
)
f
.
write
(
f
"__commit__ = '
{
sha
}
'
\n
"
)
f
.
write
(
f
"__commit__ = '
{
sha
}
'
\n
"
)
...
@@ -236,9 +269,11 @@ class clean(distutils.command.clean.clean):
...
@@ -236,9 +269,11 @@ class clean(distutils.command.clean.clean):
def
main
():
def
main
():
sha
=
check_output
([
"git"
,
"rev-parse"
,
"HEAD"
])
# commit id
branch
=
check_output
([
"git"
,
"rev-parse"
,
"--abbrev-ref"
,
"HEAD"
])
tag
=
check_output
([
"git"
,
"describe"
,
"--tags"
,
"--exact-match"
,
"@"
])
sha
=
_run_cmd
([
"git"
,
"rev-parse"
,
"HEAD"
])
# commit id
branch
=
_run_cmd
([
"git"
,
"rev-parse"
,
"--abbrev-ref"
,
"HEAD"
])
tag
=
_run_cmd
([
"git"
,
"describe"
,
"--tags"
,
"--exact-match"
,
"@"
])
print
(
"-- Git branch:"
,
branch
)
print
(
"-- Git branch:"
,
branch
)
print
(
"-- Git SHA:"
,
sha
)
print
(
"-- Git SHA:"
,
sha
)
print
(
"-- Git tag:"
,
tag
)
print
(
"-- Git tag:"
,
tag
)
...
@@ -296,11 +331,10 @@ def main():
...
@@ -296,11 +331,10 @@ def main():
'test'
:
[
'nose'
,
'torchaudio==0.10.2'
],
'test'
:
[
'nose'
,
'torchaudio==0.10.2'
],
},
},
cmdclass
=
{
cmdclass
=
{
"build_ext"
:
setup_helpers
.
CMakeBuild
,
'develop'
:
DevelopCommand
,
'develop'
:
DevelopCommand
,
'install'
:
InstallCommand
,
'upload'
:
UploadCommand
,
'test'
:
TestCommand
,
'test'
:
TestCommand
,
"build_ext"
:
setup_helpers
.
CMakeBuil
d
,
'upload'
:
UploadComman
d
,
"clean"
:
clean
,
"clean"
:
clean
,
},
},
...
...
tools/setup_helpers/extension.py
浏览文件 @
ad3b1abf
...
@@ -76,7 +76,7 @@ class CMakeBuild(build_ext):
...
@@ -76,7 +76,7 @@ class CMakeBuild(build_ext):
return
return
extdir
=
os
.
path
.
abspath
(
extdir
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
self
.
get_ext_f
ilename
(
ext
.
name
)))
os
.
path
.
dirname
(
self
.
get_ext_f
ullpath
(
ext
.
name
)))
# required for auto-detection of auxiliary "native" libs
# required for auto-detection of auxiliary "native" libs
if
not
extdir
.
endswith
(
os
.
path
.
sep
):
if
not
extdir
.
endswith
(
os
.
path
.
sep
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录