提交 10819e0f 编写于 作者: H huangyuxin

not install ctc on win, test=asr

上级 62c50e00
...@@ -14,12 +14,14 @@ ...@@ -14,12 +14,14 @@
from .deepspeech2 import DeepSpeech2InferModel from .deepspeech2 import DeepSpeech2InferModel
from .deepspeech2 import DeepSpeech2Model from .deepspeech2 import DeepSpeech2Model
from paddlespeech.s2t.utils import dynamic_pip_install from paddlespeech.s2t.utils import dynamic_pip_install
import sys
try: try:
import paddlespeech_ctcdecoders import paddlespeech_ctcdecoders
except ImportError: except ImportError:
try: try:
package_name = 'paddlespeech_ctcdecoders' package_name = 'paddlespeech_ctcdecoders'
if sys.platform != "win32":
dynamic_pip_install.install(package_name) dynamic_pip_install.install(package_name)
except Exception: except Exception:
raise RuntimeError( raise RuntimeError(
......
...@@ -14,12 +14,14 @@ ...@@ -14,12 +14,14 @@
from .deepspeech2 import DeepSpeech2InferModelOnline from .deepspeech2 import DeepSpeech2InferModelOnline
from .deepspeech2 import DeepSpeech2ModelOnline from .deepspeech2 import DeepSpeech2ModelOnline
from paddlespeech.s2t.utils import dynamic_pip_install from paddlespeech.s2t.utils import dynamic_pip_install
import sys
try: try:
import paddlespeech_ctcdecoders import paddlespeech_ctcdecoders
except ImportError: except ImportError:
try: try:
package_name = 'paddlespeech_ctcdecoders' package_name = 'paddlespeech_ctcdecoders'
if sys.platform != "win32":
dynamic_pip_install.install(package_name) dynamic_pip_install.install(package_name)
except Exception: except Exception:
raise RuntimeError( raise RuntimeError(
......
...@@ -22,6 +22,7 @@ from paddlespeech.s2t.modules.align import Linear ...@@ -22,6 +22,7 @@ from paddlespeech.s2t.modules.align import Linear
from paddlespeech.s2t.modules.loss import CTCLoss from paddlespeech.s2t.modules.loss import CTCLoss
from paddlespeech.s2t.utils import ctc_utils from paddlespeech.s2t.utils import ctc_utils
from paddlespeech.s2t.utils.log import Log from paddlespeech.s2t.utils.log import Log
import sys
logger = Log(__name__).getlog() logger = Log(__name__).getlog()
...@@ -34,6 +35,7 @@ except ImportError: ...@@ -34,6 +35,7 @@ except ImportError:
try: try:
from paddlespeech.s2t.utils import dynamic_pip_install from paddlespeech.s2t.utils import dynamic_pip_install
package_name = 'paddlespeech_ctcdecoders' package_name = 'paddlespeech_ctcdecoders'
if sys.platform != "win32":
dynamic_pip_install.install(package_name) dynamic_pip_install.install(package_name)
from paddlespeech.s2t.decoders.ctcdecoder import ctc_beam_search_decoding_batch # noqa: F401 from paddlespeech.s2t.decoders.ctcdecoder import ctc_beam_search_decoding_batch # noqa: F401
from paddlespeech.s2t.decoders.ctcdecoder import ctc_greedy_decoding # noqa: F401 from paddlespeech.s2t.decoders.ctcdecoder import ctc_greedy_decoding # noqa: F401
......
...@@ -154,6 +154,7 @@ class SpeedPerturbationSox(): ...@@ -154,6 +154,7 @@ class SpeedPerturbationSox():
package = "sox" package = "sox"
dynamic_pip_install.install(package) dynamic_pip_install.install(package)
package = "soxbindings" package = "soxbindings"
if sys.platform != "win32":
dynamic_pip_install.install(package) dynamic_pip_install.install(package)
import soxbindings as sox import soxbindings as sox
except Exception: except Exception:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册