Skip to content

Commit

Permalink
【Fix Speech Issue No.5】issue 3444 transformation import error (Paddle…
Browse files Browse the repository at this point in the history
…Paddle#3779)

* fix paddlespeech.s2t.transform.transformation import error

* fix paddlespeech.s2t.transform import error
  • Loading branch information
kk-2000 authored and luotao1 committed Jun 11, 2024
1 parent 11decf9 commit 27b874f
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion audio/tests/features/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def initWavInput(self, url=wav_url):
self.waveform, self.sr = load(os.path.abspath(os.path.basename(url)))
self.waveform = self.waveform.astype(
np.float32
) # paddlespeech.s2t.transform.spectrogram only supports float32
) # paddlespeech.audio.transform.spectrogram only supports float32
dim = len(self.waveform.shape)

assert dim in [1, 2]
Expand Down
4 changes: 2 additions & 2 deletions audio/tests/features/test_istft.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from paddleaudio.functional.window import get_window

from .base import FeatTest
from paddlespeech.s2t.transform.spectrogram import IStft
from paddlespeech.s2t.transform.spectrogram import Stft
from paddlespeech.audio.transform.spectrogram import IStft
from paddlespeech.audio.transform.spectrogram import Stft


class TestIstft(FeatTest):
Expand Down
2 changes: 1 addition & 1 deletion audio/tests/features/test_log_melspectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import paddleaudio

from .base import FeatTest
from paddlespeech.s2t.transform.spectrogram import LogMelSpectrogram
from paddlespeech.audio.transform.spectrogram import LogMelSpectrogram


class TestLogMelSpectrogram(FeatTest):
Expand Down
2 changes: 1 addition & 1 deletion audio/tests/features/test_spectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import paddleaudio

from .base import FeatTest
from paddlespeech.s2t.transform.spectrogram import Spectrogram
from paddlespeech.audio.transform.spectrogram import Spectrogram


class TestSpectrogram(FeatTest):
Expand Down
2 changes: 1 addition & 1 deletion audio/tests/features/test_stft.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from paddleaudio.functional.window import get_window

from .base import FeatTest
from paddlespeech.s2t.transform.spectrogram import Stft
from paddlespeech.audio.transform.spectrogram import Stft


class TestStft(FeatTest):
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/asr/tutorial_transformer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@
"warnings.filterwarnings('ignore')\n",
"\n",
"from yacs.config import CfgNode\n",
"from paddlespeech.s2t.transform.spectrogram import LogMelSpectrogramKaldi\n",
"from paddlespeech.s2t.transform.cmvn import GlobalCMVN\n",
"from paddlespeech.audio.transform.spectrogram import LogMelSpectrogramKaldi\n",
"from paddlespeech.audio.transform.cmvn import GlobalCMVN\n",
"from paddlespeech.s2t.frontend.featurizer.text_featurizer import TextFeaturizer\n",
"from paddlespeech.s2t.models.u2 import U2Model\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion utils/apply-cmvn.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy
from distutils.util import strtobool

from paddlespeech.s2t.transform.cmvn import CMVN
from paddlespeech.audio.transform.cmvn import CMVN
from paddlespeech.s2t.utils.cli_readers import file_reader_helper
from paddlespeech.s2t.utils.cli_utils import get_commandline_args
from paddlespeech.s2t.utils.cli_utils import is_scipy_wav_style
Expand Down
2 changes: 1 addition & 1 deletion utils/compute-cmvn-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import kaldiio
import numpy as np

from paddlespeech.s2t.transform.transformation import Transformation
from paddlespeech.audio.transform.transformation import Transformation
from paddlespeech.s2t.utils.cli_readers import file_reader_helper
from paddlespeech.s2t.utils.cli_utils import get_commandline_args
from paddlespeech.s2t.utils.cli_utils import is_scipy_wav_style
Expand Down
2 changes: 1 addition & 1 deletion utils/copy-feats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from distutils.util import strtobool

from paddlespeech.s2t.transform.transformation import Transformation
from paddlespeech.audio.transform.transformation import Transformation
from paddlespeech.s2t.utils.cli_readers import file_reader_helper
from paddlespeech.s2t.utils.cli_utils import get_commandline_args
from paddlespeech.s2t.utils.cli_utils import is_scipy_wav_style
Expand Down
2 changes: 1 addition & 1 deletion utils/feat-to-shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import sys

from paddlespeech.s2t.transform.transformation import Transformation
from paddlespeech.audio.transform.transformation import Transformation
from paddlespeech.s2t.utils.cli_readers import file_reader_helper
from paddlespeech.s2t.utils.cli_utils import get_commandline_args
from paddlespeech.s2t.utils.cli_utils import is_scipy_wav_style
Expand Down

0 comments on commit 27b874f

Please sign in to comment.