Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6936ff

Browse files
MatthewInkawhichJoelMarcey
authored andcommitted
Fixed headings in saving_loading_models tutorial and wording/grammatical nits in chatbot_tutorial (#343)
1 parent 2ca462b commit d6936ff

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

beginner_source/chatbot_tutorial.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@
3737
# .. code:: python
3838
#
3939
# > hello?
40-
# bot: hello .
40+
# Bot: hello .
4141
# > where am I?
42-
# bot: you re in a hospital .
42+
# Bot: you re in a hospital .
4343
# > who are you?
44-
# bot: i m a lawyer .
44+
# Bot: i m a lawyer .
4545
# > how are you doing?
46-
# bot: i m fine .
46+
# Bot: i m fine .
4747
# > are you my friend?
48-
# bot: no .
48+
# Bot: no .
4949
# > you're under arrest
50-
# bot: i m trying to help you !
50+
# Bot: i m trying to help you !
5151
# > i'm just kidding
52-
# bot: i m sorry .
52+
# Bot: i m sorry .
5353
# > where are you from?
54-
# bot: san francisco .
54+
# Bot: san francisco .
5555
# > it's time for me to leave
56-
# bot: i know .
56+
# Bot: i know .
5757
# > goodbye
58-
# bot: goodbye .
58+
# Bot: goodbye .
5959
#
6060
# **Tutorial Highlights**
6161
#
@@ -159,9 +159,8 @@ def printLines(file, n=10):
159159
# Create formatted data file
160160
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
161161
#
162-
# Now it is time to use the functions that we defined above to create an
163-
# appropriately formatted data file. Each line of this new file will
164-
# contain a tab-separated *query sentence* and a *response sentence* pair.
162+
# For convenience, we'll create a nicely formatted data file in which each line
163+
# contains a tab-separated *query sentence* and a *response sentence* pair.
165164
#
166165
# The following functions facilitate the parsing of the raw
167166
# *movie_lines.txt* data file.
@@ -459,8 +458,8 @@ def trimRareWords(voc, pairs, MIN_COUNT):
459458
# Prepare Data for Models
460459
# -----------------------
461460
#
462-
# Although we have spent a great effort preparing and massaging our data
463-
# into a nice vocabulary object and list of sentence pairs, our models
461+
# Although we have put a great deal of effort into preparing and massaging our
462+
# data into a nice vocabulary object and list of sentence pairs, our models
464463
# will ultimately expect numerical torch tensors as inputs. One way to
465464
# prepare the processed data for the models can be found in the `seq2seq
466465
# translation

beginner_source/saving_loading_models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
*state_dict*. For more information on *state_dict*, see `What is a
3030
state_dict? <#what-is-a-state-dict>`__.
3131
32+
33+
3234
**Contents:**
3335
3436
- `What is a state_dict? <#what-is-a-state-dict>`__
@@ -429,7 +431,7 @@
429431
# ``my_tensor = my_tensor.to(torch.device('cuda'))``.
430432
#
431433
# Save on CPU, Load on GPU
432-
# ~~~~~~~~~~~~~~~~~~~~~~~~
434+
# ^^^^^^^^^^^^^^^^^^^^^^^^
433435
#
434436
# **Save:**
435437
#
@@ -459,7 +461,7 @@
459461
# overwrite tensors: ``my_tensor = my_tensor.to(torch.device('cuda'))``.
460462
#
461463
# Saving ``torch.nn.DataParallel`` Models
462-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
464+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
463465
#
464466
# **Save:**
465467
#

0 commit comments

Comments
 (0)