From 10819e0fa23a9e8a4c63d9e2ec82f9591a539c2f Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Mon, 30 May 2022 13:57:52 +0000 Subject: [PATCH] not install ctc on win, test=asr --- paddlespeech/s2t/models/ds2/__init__.py | 4 +++- paddlespeech/s2t/models/ds2_online/__init__.py | 4 +++- paddlespeech/s2t/modules/ctc.py | 4 +++- paddlespeech/s2t/transform/perturb.py | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/paddlespeech/s2t/models/ds2/__init__.py b/paddlespeech/s2t/models/ds2/__init__.py index b3222067..0a5c50d8 100644 --- a/paddlespeech/s2t/models/ds2/__init__.py +++ b/paddlespeech/s2t/models/ds2/__init__.py @@ -14,13 +14,15 @@ from .deepspeech2 import DeepSpeech2InferModel from .deepspeech2 import DeepSpeech2Model from paddlespeech.s2t.utils import dynamic_pip_install +import sys try: import paddlespeech_ctcdecoders except ImportError: try: package_name = 'paddlespeech_ctcdecoders' - dynamic_pip_install.install(package_name) + if sys.platform != "win32": + dynamic_pip_install.install(package_name) except Exception: raise RuntimeError( "Can not install package paddlespeech_ctcdecoders on your system. \ diff --git a/paddlespeech/s2t/models/ds2_online/__init__.py b/paddlespeech/s2t/models/ds2_online/__init__.py index c5fdab1b..de772b64 100644 --- a/paddlespeech/s2t/models/ds2_online/__init__.py +++ b/paddlespeech/s2t/models/ds2_online/__init__.py @@ -14,13 +14,15 @@ from .deepspeech2 import DeepSpeech2InferModelOnline from .deepspeech2 import DeepSpeech2ModelOnline from paddlespeech.s2t.utils import dynamic_pip_install +import sys try: import paddlespeech_ctcdecoders except ImportError: try: package_name = 'paddlespeech_ctcdecoders' - dynamic_pip_install.install(package_name) + if sys.platform != "win32": + dynamic_pip_install.install(package_name) except Exception: raise RuntimeError( "Can not install package paddlespeech_ctcdecoders on your system. \ diff --git a/paddlespeech/s2t/modules/ctc.py b/paddlespeech/s2t/modules/ctc.py index 33ad472d..ca576eef 100644 --- a/paddlespeech/s2t/modules/ctc.py +++ b/paddlespeech/s2t/modules/ctc.py @@ -22,6 +22,7 @@ from paddlespeech.s2t.modules.align import Linear from paddlespeech.s2t.modules.loss import CTCLoss from paddlespeech.s2t.utils import ctc_utils from paddlespeech.s2t.utils.log import Log +import sys logger = Log(__name__).getlog() @@ -34,7 +35,8 @@ except ImportError: try: from paddlespeech.s2t.utils import dynamic_pip_install package_name = 'paddlespeech_ctcdecoders' - dynamic_pip_install.install(package_name) + if sys.platform != "win32": + 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_greedy_decoding # noqa: F401 from paddlespeech.s2t.decoders.ctcdecoder import Scorer # noqa: F401 diff --git a/paddlespeech/s2t/transform/perturb.py b/paddlespeech/s2t/transform/perturb.py index 9e41b824..b18caefb 100644 --- a/paddlespeech/s2t/transform/perturb.py +++ b/paddlespeech/s2t/transform/perturb.py @@ -154,7 +154,8 @@ class SpeedPerturbationSox(): package = "sox" dynamic_pip_install.install(package) package = "soxbindings" - dynamic_pip_install.install(package) + if sys.platform != "win32": + dynamic_pip_install.install(package) import soxbindings as sox except Exception: raise RuntimeError(