From 9064b93e2c59a88cfd4106806fd1bed0f3edd6bf Mon Sep 17 00:00:00 2001 From: YangZhou <56786796+SmileGoat@users.noreply.github.com> Date: Tue, 13 Dec 2022 18:17:37 +0800 Subject: [PATCH] [audio]patch:fix tensor_utils error (#2738) (#2739) * fix tensor utils --- audio/README.md | 3 +-- audio/paddleaudio/src/pybind/pybind.cpp | 2 ++ paddlespeech/s2t/models/u2_st/u2_st.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/audio/README.md b/audio/README.md index f336ac9a..bfd8625f 100644 --- a/audio/README.md +++ b/audio/README.md @@ -29,7 +29,6 @@ MAC:test build whl envrioment: * gcc/g++/gfortran 12.2.0 * cpu Intel Xeon E5 x86_64 - Windows: not support: paddleaudio C++ extension lib (sox io, kaldi native fbank) -python setup.py bdist_wheel \ No newline at end of file +python setup.py bdist_wheel diff --git a/audio/paddleaudio/src/pybind/pybind.cpp b/audio/paddleaudio/src/pybind/pybind.cpp index c4dfa8d5..692e8099 100644 --- a/audio/paddleaudio/src/pybind/pybind.cpp +++ b/audio/paddleaudio/src/pybind/pybind.cpp @@ -1,7 +1,9 @@ // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +#ifdef INCLUDE_KALDI #include "paddleaudio/src/pybind/kaldi/kaldi_feature.h" #include "paddleaudio/third_party/kaldi/feat/feature-fbank.h" +#endif #ifdef INCLUDE_SOX #include "paddleaudio/src/pybind/sox/io.h" diff --git a/paddlespeech/s2t/models/u2_st/u2_st.py b/paddlespeech/s2t/models/u2_st/u2_st.py index 016087d6..31defbba 100644 --- a/paddlespeech/s2t/models/u2_st/u2_st.py +++ b/paddlespeech/s2t/models/u2_st/u2_st.py @@ -24,9 +24,9 @@ from typing import Tuple import paddle from paddle import jit from paddle import nn -from paddleaudio.utils.tensor_utils import add_sos_eos -from paddleaudio.utils.tensor_utils import th_accuracy +from paddlespeech.audio.utils.tensor_utils import add_sos_eos +from paddlespeech.audio.utils.tensor_utils import th_accuracy from paddlespeech.s2t.frontend.utility import IGNORE_ID from paddlespeech.s2t.frontend.utility import load_cmvn from paddlespeech.s2t.modules.cmvn import GlobalCMVN -- GitLab