Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2.4 #576

Merged
merged 42 commits into from
Mar 7, 2023
Merged

2.2.4 #576

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2780f0f
Fix error in some common voice japanese file paths
mmcauliffe Feb 17, 2023
22ca4ab
Add extra validation to textgrid interval start/end timestamps
mmcauliffe Feb 17, 2023
059daf1
Ensure GITHUB_TOKEN is available for tests
mmcauliffe Feb 17, 2023
e0b7490
Try to fix failing test runner
mmcauliffe Feb 18, 2023
a277966
Fix error in processing opus files
mmcauliffe Feb 18, 2023
f80b0f7
Remove GITHUB_TOKEN env variable
mmcauliffe Feb 18, 2023
bddb49b
Fix for logging disappearing after API runs
mmcauliffe Feb 18, 2023
7074ade
Attempt to fix CI
mmcauliffe Feb 18, 2023
ac241e7
Fix environment yaml
mmcauliffe Feb 18, 2023
55cdd7f
Fix mamba install
mmcauliffe Feb 18, 2023
9f0d517
Add clean up for initial tests?
mmcauliffe Feb 18, 2023
36046fe
Fix failing test
mmcauliffe Feb 18, 2023
ea60694
Add back in github token
mmcauliffe Feb 18, 2023
b178c0d
Attempt to fix test runner
mmcauliffe Feb 19, 2023
09454d9
remove test timing out
mmcauliffe Feb 19, 2023
8eca112
attempt to fix tests
mmcauliffe Feb 20, 2023
69ee10f
Attempt to fix github actions
mmcauliffe Feb 23, 2023
ff66e90
Update connections to use sockets
mmcauliffe Mar 2, 2023
38e3cd9
Switch over to using a dedicated server command
mmcauliffe Mar 2, 2023
8849a9d
Fix initialize bug on linux
mmcauliffe Mar 2, 2023
c9715e7
Add log output for database initialization
mmcauliffe Mar 2, 2023
0216fed
Config debugging on CI
mmcauliffe Mar 2, 2023
36ee223
Remove github token
mmcauliffe Mar 2, 2023
e8e70b8
Fix typo
mmcauliffe Mar 2, 2023
c2c71e6
Attempt to fix CI
mmcauliffe Mar 2, 2023
5d781eb
Another attempt
mmcauliffe Mar 2, 2023
8087aea
Another attempt
mmcauliffe Mar 3, 2023
fdc4f89
Fix wrong error message on start up
mmcauliffe Mar 3, 2023
13f7d6d
Another attempt
mmcauliffe Mar 3, 2023
d16ada2
Ensure sessions closing
mmcauliffe Mar 3, 2023
bb7efcb
Add support for piping to mfa g2p
mmcauliffe Mar 5, 2023
d6bd311
Add more debugging information for CI failures
mmcauliffe Mar 5, 2023
3a96687
Add timeout to tests
mmcauliffe Mar 5, 2023
f5998ec
Increase test timeout
mmcauliffe Mar 5, 2023
9026b40
reduce timeout
mmcauliffe Mar 5, 2023
808b013
reduce timout
mmcauliffe Mar 6, 2023
a11746d
timeout on the failing test
mmcauliffe Mar 6, 2023
8525d4d
Add timeouts to all alignment tests
mmcauliffe Mar 6, 2023
003443f
Remove sqlalchemy debug output
mmcauliffe Mar 6, 2023
10d023f
add back in github token
mmcauliffe Mar 6, 2023
e929572
Add support for per-utterance G2P
mmcauliffe Mar 6, 2023
fd550ad
Clean up
mmcauliffe Mar 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add clean up for initial tests?
  • Loading branch information
mmcauliffe committed Feb 18, 2023
commit 9f0d51774dced48c1251f5db7d0ca6d3a62f14e9
8 changes: 7 additions & 1 deletion tests/test_acoustic_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_basic_mono(
a.train()
a.export_model(mono_align_model_path)
assert mono_align_model_path.exists()
a.clean_working_directory()
del a
time.sleep(3)
a = PretrainedAligner(
Expand All @@ -47,6 +48,7 @@ def test_basic_mono(
a.align()
a.export_files(mono_output_directory)
assert mono_output_directory.exists()
a.clean_working_directory()


def test_pronunciation_training(
Expand Down Expand Up @@ -75,7 +77,7 @@ def test_pronunciation_training(
assert rule_query.probability > 0
assert rule_query.probability < 1

a.cleanup()
a.clean_working_directory()
assert not export_path.exists()
assert not (generated_dir.joinpath("pron_train_test_export", mixed_dict_path.name).exists())

Expand All @@ -90,6 +92,7 @@ def test_pronunciation_training(
assert generated_dir.joinpath(
"pron_train_test_export", mixed_dict_path.with_suffix(".dict").name
).exists()
a.clean_working_directory()


def test_pitch_feature_training(
Expand All @@ -105,6 +108,7 @@ def test_pitch_feature_training(
assert a.use_pitch
a.train()
assert a.get_feat_dim() == 45
a.clean_working_directory()


def test_basic_lda(basic_dict_path, basic_corpus_dir, lda_train_config_path, db_setup):
Expand All @@ -118,6 +122,7 @@ def test_basic_lda(basic_dict_path, basic_corpus_dir, lda_train_config_path, db_
a.train()
assert len(a.training_configs[a.final_identifier].realignment_iterations) > 0
assert len(a.training_configs[a.final_identifier].mllt_iterations) > 1
a.clean_working_directory()


@pytest.mark.skip("Inconsistent failing")
Expand All @@ -139,3 +144,4 @@ def test_basic_sat(

assert output_model_path.exists()
assert a.output_directory.joinpath("sat", "trans.1.1.ark").exists()
a.clean_working_directory()
2 changes: 2 additions & 0 deletions tests/test_alignment_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_align_sick(
assert "AY_S" in a.phone_mapping
a.export_files(export_directory)
assert os.path.exists(os.path.join(export_directory, "michael", "acoustic_corpus.TextGrid"))
a.clean_working_directory()


def test_align_one(
Expand Down Expand Up @@ -83,3 +84,4 @@ def test_align_one(
assert utterance.alignment_log_likelihood is not None
assert utterance.features is None
assert len(utterance.phone_intervals) > 0
a.clean_working_directory()
5 changes: 4 additions & 1 deletion tests/test_commandline_adapt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil

import click.testing

Expand Down Expand Up @@ -37,6 +38,7 @@ def test_adapt_basic(
print(result.exc_info)
raise result.exception
assert os.path.exists(adapted_model_path)
shutil.rmtree(temp_dir.joinpath("adapt_cli"))


def test_adapt_multilingual(
Expand All @@ -58,7 +60,7 @@ def test_adapt_multilingual(
adapted_model_path,
output_path,
"-t",
temp_dir,
temp_dir.joinpath("multilingual_adapt"),
"--config_path",
basic_align_config_path,
"-q",
Expand All @@ -75,3 +77,4 @@ def test_adapt_multilingual(
print(result.exc_info)
raise result.exception
assert os.path.exists(adapted_model_path)
shutil.rmtree(temp_dir.joinpath("multilingual_adapt"))
30 changes: 18 additions & 12 deletions tests/test_commandline_align.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import os
import shutil

import click.testing
from praatio import textgrid as tgio

from montreal_forced_aligner.command_line.mfa import mfa_cli


def assert_export_exist(old_directory, new_directory):
for root, dirs, files in os.walk(old_directory):
new_root = root.replace(old_directory, new_directory)
for d in dirs:
assert os.path.exists(os.path.join(new_root, d))
for f in files:
if not f.endswith(".wav"):
continue
new_f = f.replace(".wav", ".TextGrid")
assert os.path.exists(os.path.join(new_root, new_f))


def test_align_no_speaker_adaptation(
basic_corpus_dir,
generated_dir,
Expand All @@ -44,6 +33,7 @@ def test_align_no_speaker_adaptation(
command = [str(x) for x in command]
click.testing.CliRunner().invoke(mfa_cli, command, catch_exceptions=False)
assert os.path.exists(output_directory)
shutil.rmtree(os.path.join(temp_dir, "test_align_no_speaker_adaptation"))


def test_align_single_speaker(
Expand Down Expand Up @@ -94,6 +84,7 @@ def test_align_single_speaker(

for path in output_paths:
assert os.path.exists(path)
shutil.rmtree(os.path.join(temp_dir, "test_align_single_speaker"))


def test_align_duplicated(
Expand Down Expand Up @@ -140,6 +131,7 @@ def test_align_duplicated(

for path in output_paths:
assert os.path.exists(path)
shutil.rmtree(os.path.join(temp_dir, "test_align_duplicated"))


def test_align_multilingual(
Expand Down Expand Up @@ -177,6 +169,7 @@ def test_align_multilingual(
print(result.exc_info)
raise result.exception
assert not result.return_value
shutil.rmtree(os.path.join(temp_dir, "test_align_multilingual"))


def test_align_multilingual_speaker_dict(
Expand Down Expand Up @@ -214,6 +207,7 @@ def test_align_multilingual_speaker_dict(
print(result.exc_info)
raise result.exception
assert not result.return_value
shutil.rmtree(os.path.join(temp_dir, "test_align_multilingual_speaker_dict"))


def test_align_multilingual_tg_speaker_dict(
Expand Down Expand Up @@ -250,6 +244,7 @@ def test_align_multilingual_tg_speaker_dict(
print(result.exc_info)
raise result.exception
assert not result.return_value
shutil.rmtree(os.path.join(temp_dir, "test_align_multilingual_tg_speaker_dict"))


def test_align_evaluation(
Expand Down Expand Up @@ -294,6 +289,7 @@ def test_align_evaluation(
print(result.exc_info)
raise result.exception
assert not result.return_value
shutil.rmtree(os.path.join(temp_dir, "test_align_evaluation"))


def test_align_split(
Expand Down Expand Up @@ -334,6 +330,7 @@ def test_align_split(
print(result.exc_info)
raise result.exception
assert not result.return_value
shutil.rmtree(os.path.join(temp_dir, "test_align_split"))


def test_align_stereo(
Expand Down Expand Up @@ -374,6 +371,7 @@ def test_align_stereo(
os.path.join(output_dir, "michaelandsickmichael.TextGrid"), includeEmptyIntervals=False
)
assert len(tg.tierNames) == 4
shutil.rmtree(os.path.join(temp_dir, "test_align_stereo"))


def test_align_mp3s(
Expand Down Expand Up @@ -415,6 +413,8 @@ def test_align_mp3s(
)
assert len(tg.tierNames) == 2

shutil.rmtree(os.path.join(temp_dir, "test_align_mp3s"))


def test_align_opus(
opus_corpus_dir,
Expand Down Expand Up @@ -454,6 +454,7 @@ def test_align_opus(
os.path.join(output_dir, "13697_11991_000000.TextGrid"), includeEmptyIntervals=False
)
assert len(tg.tierNames) == 2
shutil.rmtree(os.path.join(temp_dir, "test_align_opus"))


def test_swedish_cv(
Expand Down Expand Up @@ -503,6 +504,8 @@ def test_swedish_cv(
tg = tgio.openTextgrid(tg_path, includeEmptyIntervals=False)
assert len(tg.tierNames) == 2

shutil.rmtree(os.path.join(temp_dir, "test_swedish_cv"))


def test_swedish_mfa(
swedish_dir,
Expand Down Expand Up @@ -551,6 +554,8 @@ def test_swedish_mfa(
tg = tgio.openTextgrid(tg_path, includeEmptyIntervals=False)
assert len(tg.tierNames) == 2

shutil.rmtree(os.path.join(temp_dir, "test_swedish_mfa"))


def test_acoustic_g2p_model(
basic_corpus_dir,
Expand Down Expand Up @@ -600,3 +605,4 @@ def test_acoustic_g2p_model(

for path in output_paths:
assert os.path.exists(path)
shutil.rmtree(os.path.join(temp_dir, "test_acoustic_g2p_model"))