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

[release/0.10] Port the recent doc updates #2059

Merged
merged 16 commits into from
Dec 3, 2021

Conversation

mthrok
Copy link
Collaborator

@mthrok mthrok commented Dec 3, 2021

Cherry-pick the recent documentation update on main branch to release/0.10 branch for the upcoming minor release.

mthrok and others added 16 commits December 3, 2021 18:00
With the introduction of TTS tutorial (pytorch#1973), it takes more than couple of minutes
to build documentation. This commit makes the doc build process defaults to
not build tutorials.

To build tutorials one can use environment variable `BUILD_GALLERY=1`,
and set `GALLERY_PATTERN=...` to filter the tutorials to build.

This `GALLERY_PATTERN` is same approach as in `tutorials` repo.

https://github.com/pytorch/tutorials/blob/cbf2238df0e78d84c15bd94288966d2f4b2e83ae/conf.py#L75-L83

Also this commit dynamically parse the subdirectory of `examples/gallery` so that when a new category of examples are added, it will automatically parsed.
This commit adds colab/download/source link to tutorials, like in `pytorch/tutorials` repo.

Since the upstream `pytorch-sphinx-theme` does not provide the interface for this,
a hack to overwrite the URL is added.

This hack might stop working if there is some update in `pytorch-sphinx-theme`.
The hack introduced in pytorch#1969 could break if upstream theme changes its HTML or Javascript.
To prevent our documentation from randomly break, this commit fixes the commit of the them.
It turned out that generated tutorials can embed the audio if the following conditions are met.
This commit changes how audio samples are shown in tutorials so that they become playable in doc.

1. There is only one `IPython.display.Audio` call in a cell
2. An object of `IPython.display.Audio` is the last object interpreter receives in the cell
3. Audio format is `wav`
   (`flac` can be embedded as well, but browsers (Chrome/Safari) won't play it)

Ref: https://stackoverflow.com/a/33109647
* Refactor tutorial organization

* Merge tutorial subdirectoris under to examples/gallery/tutorials
* Do not use index.rst generated by Sphinx-gallery
* Instead use flat structure so that all the tutorials are listed in left menu
* Use `_assets` dir for artifacts of tutorials
- Add link to index page on left
- Package Reference -> API Reference
- Update description.
Summary:
While updating the documentation in release/0.10, a HIP error was raised.
https://app.circleci.com/pipelines/github/pytorch/audio/8577/workflows/02c6ff44-a042-4f9a-8fb8-573a231f60db/jobs/452639

This happens because `pip install torchaudio -f https://...` defaults to
ROCm version while `build_doc` is supposed to pick the CPU version.

Adding suffix `+cpu` should resolve the isssue.

It is validated on pytorch#2060 https://app.circleci.com/pipelines/github/pytorch/audio/8584/workflows/25ae26e5-273f-46f8-805d-ffc7b6b8eb58/jobs/453337

Pull Request resolved: pytorch#2060

Reviewed By: carolineechen

Differential Revision: D32846765

Pulled By: mthrok

fbshipit-source-id: e6b3b32646388b8c4ba864639f8b62d8b9d39844
@mthrok mthrok merged commit 4065ff2 into pytorch:release/0.10 Dec 3, 2021
@mthrok mthrok deleted the doc-update branch December 4, 2021 04:26
mthrok pushed a commit to mthrok/audio that referenced this pull request Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants