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

Update decoder pretrained lm docs #2291

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion docs/source/prototype.ctc_decoder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ Factory Function
----------------

lexicon_decoder
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~

.. autoclass:: lexicon_decoder

Utility Function
----------------

download_pretrained_files
~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: download_pretrained_files

References
----------

Expand Down
14 changes: 8 additions & 6 deletions torchaudio/prototype/ctc_decoder/ctc_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,17 @@ def download_pretrained_files(model: str) -> _PretrainedFiles:
Retrieves pretrained data files used for CTC decoder.

Args:
model (str): pretrained language model to download
model (str): pretrained language model to download.
Options: ["librispeech-3-gram", "librispeech-4-gram", "librispeech"]

Returns:
Object with the following attributes:
lm: path corresponding to downloaded language model, or None if model is not
associated with an lm
lexicon: path corresponding to downloaded lexicon file
tokens: path corresponding to downloaded tokens file
Object with the following attributes
lm:
path corresponding to downloaded language model, or `None` if the model is not associated with an lm
lexicon:
path corresponding to downloaded lexicon file
tokens:
path corresponding to downloaded tokens file
"""

files = _get_filenames(model)
Expand Down