Skip to content

add explicit instructions to install torchdata #1859

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 1 commit into from
Mar 13, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions advanced_source/ddp_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ def run_worker(rank, world_size):


######################################################################
# The training process uses Wikitext-2 dataset from ``torchtext``. The
# vocab object is built based on the train dataset and is used to numericalize
# The training process uses Wikitext-2 dataset from ``torchtext``.
# To access torchtext datasets, please install torchdata following instructions at https://github.com/pytorch/data.
#
# The vocab object is built based on the train dataset and is used to numericalize
# tokens into tensors. Starting from sequential data, the ``batchify()``
# function arranges the dataset into columns, trimming off any tokens remaining
# after the data has been divided into batches of size ``batch_size``.
Expand Down
3 changes: 3 additions & 0 deletions beginner_source/text_sentiment_ngrams_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# -----------------------------------
#
# The torchtext library provides a few raw dataset iterators, which yield the raw text strings. For example, the ``AG_NEWS`` dataset iterators yield the raw data as a tuple of label and text.
#
# To access torchtext datasets, please install torchdata following instructions at https://github.com/pytorch/data.
#

import torch
from torchtext.datasets import AG_NEWS
Expand Down
6 changes: 4 additions & 2 deletions beginner_source/transformer_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ def forward(self, x: Tensor) -> Tensor:


######################################################################
# This tutorial uses ``torchtext`` to generate Wikitext-2 dataset. The
# vocab object is built based on the train dataset and is used to numericalize
# This tutorial uses ``torchtext`` to generate Wikitext-2 dataset.
# To access torchtext datasets, please install torchdata following instructions at https://github.com/pytorch/data.
#
# The vocab object is built based on the train dataset and is used to numericalize
# tokens into tensors. Wikitext-2 represents rare tokens as `<unk>`.
#
# Given a 1-D vector of sequential data, ``batchify()`` arranges the data
Expand Down
7 changes: 4 additions & 3 deletions beginner_source/translation_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Language Translation with nn.Transformer and torchtext
======================================================

This tutorial shows, how to train a translation model from scratch using
Transformer. We will be using `Multi30k <http://www.statmt.org/wmt16/multimodal-task.html#task1>`__
dataset to train a German to English translation model.
This tutorial shows:
- How to train a translation model from scratch using Transformer.
- Use tochtext library to access `Multi30k <http://www.statmt.org/wmt16/multimodal-task.html#task1>`__ dataset to train a German to English translation model.
"""


Expand All @@ -19,6 +19,7 @@
# `Multi30k dataset from torchtext library <https://pytorch.org/text/stable/datasets.html#multi30k>`__
# that yields a pair of source-target raw sentences.
#
# To access torchtext datasets, please install torchdata following instructions at https://github.com/pytorch/data.
#

from torchtext.data.utils import get_tokenizer
Expand Down
6 changes: 4 additions & 2 deletions intermediate_source/pipeline_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ def forward(self, x):


######################################################################
# The training process uses Wikitext-2 dataset from ``torchtext``. The
# vocab object is built based on the train dataset and is used to numericalize
# The training process uses Wikitext-2 dataset from ``torchtext``.
# To access torchtext datasets, please install torchdata following instructions at https://github.com/pytorch/data.
#
# The vocab object is built based on the train dataset and is used to numericalize
# tokens into tensors. Starting from sequential data, the ``batchify()``
# function arranges the dataset into columns, trimming off any tokens remaining
# after the data has been divided into batches of size ``batch_size``.
Expand Down