Skip to content

Commit

Permalink
Update decoder pretrained lm docs (#2291)
Browse files Browse the repository at this point in the history
Summary:
`build_docs` test is failing on CI with `ImportError: cannot import name 'environmentfilter' from 'jinja2'`, but with local build:

<img width="902" alt="Screen Shot 2022-03-25 at 4 02 53 PM" src="https://user-images.githubusercontent.com/16568633/160157472-c91ff9b2-a2be-4c5d-959e-53b9f45425c6.png">

Pull Request resolved: #2291

Reviewed By: mthrok

Differential Revision: D35147098

Pulled By: carolineechen

fbshipit-source-id: 682b3800d0ed5c56b402d83f221136725051ba7e
  • Loading branch information
Caroline Chen authored and facebook-github-bot committed Mar 26, 2022
1 parent 21c1ab7 commit 46ed2b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
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

0 comments on commit 46ed2b9

Please sign in to comment.