提交 ed12db61 编写于 作者: H huangyuxin

Separate the ctcdecoders

上级 797e0834
......@@ -11,4 +11,21 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .ctcdecoder import swig_wrapper
from paddlespeech.s2t.utils.log import Log
logger = Log(__name__).getlog()
try:
from .ctcdecoder import swig_wrapper
except:
try:
import pip
if int(pip.__version__.split('.')[0])>9:
from pip._internal import main
else:
from pip import main
package_name = 'paddlespeech_ctcdecoders'
main(['install', package_name])
except Exception as e:
logger.info("paddlespeech_ctcdecoders not installed!")
......@@ -14,4 +14,19 @@
from .deepspeech2 import DeepSpeech2InferModel
from .deepspeech2 import DeepSpeech2Model
try:
import swig_decoders
except:
try:
import pip
if int(pip.__version__.split('.')[0])>9:
from pip._internal import main
else:
from pip import main
package_name = 'paddlespeech_ctcdecoders'
main(['install', package_name])
except:
raise RuntimeError("Can not install package paddlespeech_ctcdecoders on your system. \
The DeepSpeech2 model is not supported for your system")
__all__ = ['DeepSpeech2Model', 'DeepSpeech2InferModel']
......@@ -14,4 +14,20 @@
from .deepspeech2 import DeepSpeech2InferModelOnline
from .deepspeech2 import DeepSpeech2ModelOnline
try:
import swig_decoders
except:
try:
import pip
if int(pip.__version__.split('.')[0])>9:
from pip._internal import main
else:
from pip import main
package_name = 'paddlespeech_ctcdecoders'
main(['install', package_name])
except:
raise RuntimeError("Can not install package paddlespeech_ctcdecoders on your system. \
The DeepSpeech2 model is not supported for your system")
__all__ = ['DeepSpeech2ModelOnline', 'DeepSpeech2InferModelOnline']
......@@ -28,8 +28,21 @@ try:
from paddlespeech.s2t.decoders.ctcdecoder.swig_wrapper import ctc_beam_search_decoder_batch # noqa: F401
from paddlespeech.s2t.decoders.ctcdecoder.swig_wrapper import ctc_greedy_decoder # noqa: F401
from paddlespeech.s2t.decoders.ctcdecoder.swig_wrapper import Scorer # noqa: F401
except Exception as e:
logger.info("ctcdecoder not installed!")
except:
try:
import pip
if int(pip.__version__.split('.')[0])>9:
from pip._internal import main
else:
from pip import main
package_name = 'paddlespeech_ctcdecoders'
main(['install', package_name])
except Exception as e:
logger.info("paddlespeech_ctcdecoders not installed!")
#try:
#except Exception as e:
# logger.info("ctcdecoder not installed!")
__all__ = ['CTCDecoder']
......
......@@ -44,7 +44,6 @@ requirements = {
"nltk",
"pandas",
"paddleaudio",
"paddlespeech_ctcdecoders",
"paddlespeech_feat",
"praatio~=4.1",
"pypi-kenlm",
......@@ -70,6 +69,7 @@ requirements = {
"ConfigArgParse",
"coverage",
"gpustat",
"paddlespeech_ctcdecoders",
"phkit",
"Pillow",
"pybind11",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册