-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2176 from coqui-ai/wav2vec2-decoder
Wav2vec2 decoder
- Loading branch information
Showing
29 changed files
with
1,020 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,16 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import, print_function | ||
from __future__ import absolute_import, division, print_function | ||
|
||
import sys | ||
|
||
from coqui_stt_training.train import early_training_checks | ||
from coqui_stt_training.util.config import ( | ||
Config, | ||
initialize_globals_from_cli, | ||
log_error, | ||
) | ||
|
||
from coqui_stt_training.util import lm_optimize as lm_opt | ||
|
||
|
||
def main(): | ||
initialize_globals_from_cli() | ||
early_training_checks() | ||
|
||
if not Config.scorer_path: | ||
log_error( | ||
"Missing --scorer_path: can't optimize scorer alpha and beta " | ||
"parameters without a scorer!" | ||
) | ||
sys.exit(1) | ||
|
||
if not Config.test_files: | ||
log_error( | ||
"You need to specify what files to use for evaluation via " | ||
"the --test_files flag." | ||
) | ||
sys.exit(1) | ||
|
||
results = lm_opt.compute_lm_optimization() | ||
if __name__ == "__main__": | ||
print( | ||
"Best params: lm_alpha={} and lm_beta={} with WER={}".format( | ||
results.get("lm_alpha"), | ||
results.get("lm_beta"), | ||
results.get("wer"), | ||
) | ||
"Using the top level lm_optimizer.py script is deprecated and will be removed " | ||
"in a future release. Instead use: python -m coqui_stt_training.util.lm_optimize" | ||
) | ||
try: | ||
from coqui_stt_training.util import lm_optimize | ||
except ImportError: | ||
print("Training package is not installed. See training documentation.") | ||
raise | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
lm_optimize.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.