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

Add nightly build installation code snippet to prototype feature tutorials #2325

Closed
wants to merge 3 commits into from

Conversation

hwangjeff
Copy link
Contributor

Tutorial notebooks that leverage TorchAudio prototype features don't run as-is on Google Colab due to its runtime's not having nightly builds pre-installed. To make it easier for users to run said notebooks in Colab, this PR adds a code block that installs nightly Pytorch and TorchAudio builds as a comment that users can copy and run locally.

# ::
# !pip3 uninstall -y torch torchvision torchaudio
# !pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
#
Copy link
Collaborator

@mthrok mthrok Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information is almost equivalent to what https://pytorch.org/get-started/locally/ says, yet it could become obsolete if release team should decide to change the URL.

Since the new information is very specific to Google Colab, how about raising this as error message when import torchaudio.prototypes fails?

Placing something like the following after the first import torchaudio;print(torchaudio.__version__)

try:
    import torchaudio.prototype.ctc_decoder
except ModuleNotFoundError:
    print(message)
    raise

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this is the full snippet for colab to run ASR inference;

!pip3 uninstall -y torch torchvision torchaudio
!pip3 install --pre torch torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
!pip3 install sentencepiece
!add-apt-repository -y ppa:savoury1/ffmpeg4
!apt-get -qq install -y ffmpeg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Collaborator

@mthrok mthrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that tutorials with RNN-T bundle, (online_asr_tutorial.py and device_asr.py) require sentencepiece as well. Could you add that to the comment as well?

@hwangjeff hwangjeff force-pushed the tutorial_prototype_nightly branch from c4d623e to 45d529a Compare April 12, 2022 22:18
@hwangjeff hwangjeff marked this pull request as ready for review April 12, 2022 22:41
@hwangjeff hwangjeff requested a review from mthrok April 12, 2022 22:41
@facebook-github-bot
Copy link
Contributor

@hwangjeff has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Collaborator

@mthrok mthrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@github-actions
Copy link

Hey @hwangjeff.
You merged this PR, but labels were not properly added. Please add a primary and secondary label (See https://github.com/pytorch/audio/blob/main/.github/process_commit.py)

xiaohui-zhang pushed a commit to xiaohui-zhang/audio that referenced this pull request May 4, 2022
…rials (pytorch#2325)

Summary:
Tutorial notebooks that leverage TorchAudio prototype features don't run as-is on Google Colab due to its runtime's not having nightly builds pre-installed. To make it easier for users to run said notebooks in Colab, this PR adds a code block that installs nightly Pytorch and TorchAudio builds as a comment that users can copy and run locally.

Pull Request resolved: pytorch#2325

Reviewed By: xiaohui-zhang

Differential Revision: D35597753

Pulled By: hwangjeff

fbshipit-source-id: 59914e492ad72e31c0136a48cd88d697e8ea5f6c
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.

3 participants