Pretrained models#

The command for interacting with MFA models is mfa model. The subcommands allow for inspecting currently saved pretrained models, downloading ones from MFA’s model repo, and saving models you have trained to be used with a simple name rather than the full path each time.

Following installation of MFA, mfa model list acoustic will not list any models. If you want to download the default English model trained on LibriSpeech, you can run mfa model download acoustic english_us_arpa. At which point, the previous list command will output “english_us_arpa” as an option. When referring to an acoustic model in another MFA command, rather than the full path to the acoustic model, you can now supply just english_us_arpa and MFA will resolve it to the saved path.

Similarly, if you train a new model, you can run mfa model save acoustic /path/where/the/model/was/saved.zip, then this model will be available via saved in the future. The name defaults to whatever the archive is called without the directory or extension. You can modify this name with the --name NEWNAME option

There are a number of pretrained models for aligning and generating pronunciation dictionaries. The command for downloading these is mfa model download <model_type> where model_type is one of acoustic, g2p, or dictionary.

Note

Please see the MFA Models site for information and statistics about various models.

Command reference#

mfa model#

Inspect, download, and save pretrained MFA models

mfa model [OPTIONS] COMMAND [ARGS]...

Options

-h, --help#

Show this message and exit.

download#

Download pretrained models from the MFA repository. If no model names are specified, the list of all downloadable models of the given model type will be printed.

mfa model download [OPTIONS] {acoustic|dictionary|g2p|ivector|language_model}
                   [MODEL_NAME]...

Options

--github_token <github_token>#

Personal access token to use for requests to GitHub to increase rate limit.

--ignore_cache#

Flag to ignore existing downloaded models and force a re-download.

-h, --help#

Show this message and exit.

Arguments

MODEL_TYPE#

Required argument

MODEL_NAME#

Optional argument(s)

inspect#

Inspect a model and print out its metadata.

mfa model inspect [OPTIONS] {acoustic|dictionary|g2p|ivector|language_model}
                  MODEL

Options

-h, --help#

Show this message and exit.

Arguments

MODEL_TYPE#

Required argument

MODEL#

Required argument

list#

List of locally saved models.

mfa model list [OPTIONS] {acoustic|dictionary|g2p|ivector|language_model}

Options

-h, --help#

Show this message and exit.

Arguments

MODEL_TYPE#

Required argument

save#

Save a model to pretrained folder for later use

Parameters#
path: str

Path to model

model_type: str

Type of model

mfa model save [OPTIONS] {acoustic|dictionary|g2p|ivector|language_model} PATH

Options

--name <name>#

Name to use as reference (defaults to the name of the zip file).

--overwrite, --no_overwrite#

Overwrite output files when they exist, default is False

-h, --help#

Show this message and exit.

Arguments

MODEL_TYPE#

Required argument

PATH#

Required argument