Skip to content

Add download instructions for pretrained model in dynamic quantization tutorial #3379

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

Merged
Merged
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
16 changes: 12 additions & 4 deletions advanced_source/dynamic_quantization_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,18 @@ def tokenize(self, path):
# -----------------------------
#
# This is a tutorial on dynamic quantization, a quantization technique
# that is applied after a model has been trained. Therefore, we'll simply load some
# pretrained weights into this model architecture; these weights were obtained
# by training for five epochs using the default settings in the word language model
# example.
# that is applied after a model has been trained. Therefore, we'll simply
# load some pretrained weights into this model architecture; these
# weights were obtained by training for five epochs using the default
# settings in the word language model example.
#
# Before running this tutorial, download the required pre-trained model:
#
# .. code-block:: bash
#
# wget https://s3.amazonaws.com/pytorch-tutorial-assets/word_language_model_quantize.pth
#
# Place the downloaded file in the data directory or update the model_data_filepath accordingly.

ntokens = len(corpus.dictionary)

Expand Down