Skip to content

Commit bf4e412

Browse files
Add back documentation for tutorials with DeepPhonemizer fix (#3952)
Co-authored-by: Nicolas Hug <[email protected]> Co-authored-by: Sam Anklesaria <[email protected]>
1 parent 5b56239 commit bf4e412

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/build_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
9292
echo "::endgroup::"
9393
echo "::group::Build documentation"
94-
# export BUILD_GALLERY=true # TODO put this back?
94+
export BUILD_GALLERY=true
9595
(cd docs && make html)
9696
9797
echo "::endgroup::"

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"sphinx.ext.coverage",
5050
"sphinx.ext.napoleon",
5151
"sphinx.ext.viewcode",
52-
"sphinxcontrib.katex",
52+
# "sphinxcontrib.katex",
5353
"sphinxcontrib.bibtex",
5454
"sphinx_gallery.gen_gallery",
5555
"nbsphinx",

src/torchaudio/pipelines/_tts/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def _load_phonemizer(file, dl_kwargs):
161161
raise RuntimeError("DeepPhonemizer is not installed. Please install it.")
162162

163163
from dp.phonemizer import Phonemizer
164+
from dp.preprocessing.text import Preprocessor, LanguageTokenizer, SequenceTokenizer
164165

165166
# By default, dp issues DEBUG level log.
166167
logger = logging.getLogger("dp")
@@ -174,7 +175,8 @@ def _load_phonemizer(file, dl_kwargs):
174175
if not os.path.exists(path):
175176
dl_kwargs = {} if dl_kwargs is None else dl_kwargs
176177
download_url_to_file(url, path, **dl_kwargs)
177-
return Phonemizer.from_checkpoint(path)
178+
with torch.serialization.safe_globals([Preprocessor, LanguageTokenizer, SequenceTokenizer]):
179+
return Phonemizer.from_checkpoint(path)
178180
finally:
179181
logger.setLevel(orig_level)
180182

0 commit comments

Comments
 (0)