From b9a8b2a5c99d3c8992aadb84b53ec569c1f5cf57 Mon Sep 17 00:00:00 2001 From: Xabier de Zuazo Date: Sat, 1 Nov 2025 15:03:29 +0100 Subject: [PATCH 1/2] Fix restore fine-tuning behavior and add regression test --- montreal_forced_aligner/alignment/pretrained.py | 2 +- tests/test_commandline_align.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/montreal_forced_aligner/alignment/pretrained.py b/montreal_forced_aligner/alignment/pretrained.py index 236c8eaf..4aece5b5 100644 --- a/montreal_forced_aligner/alignment/pretrained.py +++ b/montreal_forced_aligner/alignment/pretrained.py @@ -89,7 +89,7 @@ def __init__( kw.update(kwargs) super().__init__(**kw) self.fine_tune = fine_tune - self.fine_tune = fine_tune_boundary_tolerance + self.fine_tune_boundary_tolerance = fine_tune_boundary_tolerance self.final_alignment = True self.kalpy_aligner = None diff --git a/tests/test_commandline_align.py b/tests/test_commandline_align.py index 61dd3e5a..9fc1fb94 100644 --- a/tests/test_commandline_align.py +++ b/tests/test_commandline_align.py @@ -444,6 +444,8 @@ def test_align_fine_tune( print(result.exc_info) raise result.exception assert not result.return_value + # Regression test for --fine_tune flag + assert "Fine tuning alignments..." in result.stderr def test_align_evaluation( From 4ca728ea0d6d4b8504a85f444e229ecb85784554 Mon Sep 17 00:00:00 2001 From: Xabier de Zuazo Date: Sat, 1 Nov 2025 15:03:39 +0100 Subject: [PATCH 2/2] Fix: remove incorrect leading dot in .ark file construction for fine-tuning --- montreal_forced_aligner/alignment/multiprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montreal_forced_aligner/alignment/multiprocessing.py b/montreal_forced_aligner/alignment/multiprocessing.py index 1972b092..c0c0bfd0 100644 --- a/montreal_forced_aligner/alignment/multiprocessing.py +++ b/montreal_forced_aligner/alignment/multiprocessing.py @@ -957,7 +957,7 @@ def _run(self): acoustic_model=self.acoustic_model, lexicon_compiler=self.lexicon_compilers[d.id], ) - ali_path = job.construct_path(workflow.working_directory, "ali", ".ark", d.name) + ali_path = job.construct_path(workflow.working_directory, "ali", "ark", d.name) alignment_archive = AlignmentArchive(ali_path) utterance_query = ( session.query(Utterance, SoundFile.sound_file_path)