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.0rc1 #387

Merged
merged 13 commits into from
Jan 11, 2022
Prev Previous commit
Fix type error
  • Loading branch information
mmcauliffe committed Jan 11, 2022
commit 2cfaece5440f5777186fa6c6daca3174b518ee1c
12 changes: 6 additions & 6 deletions montreal_forced_aligner/alignment/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,15 @@ def align_utterances(self) -> None:
break
continue
if hasattr(self, "utterances"):
self.utterances[utterance].alignment_log_likelihood = float(log_likelihood)
if hasattr(self, "frame_shift"):
num_frames = int(
self.utterances[utterance].duration * self.frame_shift
)
else:
num_frames = self.utterances[utterance].duration
self.utterances[utterance].alignment_log_likelihood /= num_frames
self.utterances[utterance].alignment_log_likelihood = (
log_likelihood / num_frames
)
pbar.update(1)
for p in procs:
p.join()
Expand All @@ -341,16 +342,15 @@ def align_utterances(self) -> None:
function = AlignFunction(args)
for utterance, log_likelihood in function.run():
if hasattr(self, "utterances"):
self.utterances[utterance].alignment_log_likelihood = float(
log_likelihood
)
if hasattr(self, "frame_shift"):
num_frames = int(
self.utterances[utterance].duration * self.frame_shift
)
else:
num_frames = self.utterances[utterance].duration
self.utterances[utterance].alignment_log_likelihood /= num_frames
self.utterances[utterance].alignment_log_likelihood = (
log_likelihood / num_frames
)
pbar.update(1)

self.compile_information()
Expand Down
2 changes: 1 addition & 1 deletion montreal_forced_aligner/alignment/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def run(self):
for line in align_proc.stdout:
line = line.strip()
utterance, log_likelihood = line.split()
yield utterance, log_likelihood
yield utterance, float(log_likelihood)


def compile_information_func(align_log_path: str) -> Dict[str, Union[List[str], float, int]]:
Expand Down
4 changes: 2 additions & 2 deletions montreal_forced_aligner/corpus/acoustic_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,12 @@ def identifier(self) -> str:
@property
def output_directory(self) -> str:
"""Root temporary directory to store corpus and dictionary files"""
return os.path.join(self.temporary_directory, self.identifier)
return self.temporary_directory

@property
def working_directory(self) -> str:
"""Working directory to save temporary corpus and dictionary files"""
return self.output_directory
return self.corpus_output_directory


class AcousticCorpusWithPronunciations(
Expand Down