Skip to content

Commit f7acad6

Browse files
committed
Move text preprocessing tests into unittest directory
1 parent 1b52e72 commit f7acad6

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.circleci/unittest/linux/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fi
5656
(
5757
set -x
5858
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa>=0.8.0' parameterized 'requests>=2.20'
59-
pip install kaldi-io SoundFile coverage pytest pytest-cov scipy transformers expecttest
59+
pip install kaldi-io SoundFile coverage pytest pytest-cov scipy transformers expecttest unidecode inflect
6060
)
6161
# Install fairseq
6262
git clone https://github.com/pytorch/fairseq

.circleci/unittest/windows/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fi
4444
(
4545
set -x
4646
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa>=0.8.0' parameterized 'requests>=2.20'
47-
pip install kaldi-io SoundFile coverage pytest pytest-cov scipy transformers expecttest
47+
pip install kaldi-io SoundFile coverage pytest pytest-cov scipy transformers expecttest unidecode inflect
4848
)
4949
# Install fairseq
5050
git clone https://github.com/pytorch/fairseq

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Optional packages to install if you want to run related tests:
8787
- `transformers`
8888
- `fairseq` (it has to be newer than `0.10.2`, so you will need to install from
8989
source. Commit `e6eddd80` is known to work.)
90+
- `unidecode` (dependency for testing text preprocessing functions for examples/pipeline_tacotron2)
91+
- `inflect` (dependency for testing text preprocessing functions for examples/pipeline_tacotron2)
9092

9193
## Development Process
9294

examples/pipeline_tacotron2/text/test_text.py renamed to test/torchaudio_unittest/example/tacotron2/test_text_preprocessing.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import unittest
2-
31
from parameterized import parameterized
42

5-
from .text_preprocessing import text_to_sequence
3+
from torchaudio._internal.module_utils import is_module_available
4+
from torchaudio_unittest.common_utils import TorchaudioTestCase, skipIfNoModule
5+
6+
if is_module_available("unidecode") and is_module_available("inflect"):
7+
from pipeline_tacotron2.text.text_preprocessing import text_to_sequence
68

79

8-
class TestTextPreprocessor(unittest.TestCase):
10+
@skipIfNoModule("unidecode")
11+
@skipIfNoModule("infect")
12+
class TestTextPreprocessor(TorchaudioTestCase):
913

1014
@parameterized.expand(
1115
[

0 commit comments

Comments
 (0)