Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Megatron-LM
Commits
d8bb57ad
Commit
d8bb57ad
authored
Apr 13, 2020
by
Mohammad
Browse files
added comment to build_index_mappings
parent
dff98d47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
megatron/data/gpt2_dataset.py
megatron/data/gpt2_dataset.py
+6
-1
No files found.
megatron/data/gpt2_dataset.py
View file @
d8bb57ad
...
@@ -141,7 +141,12 @@ class GPT2Dataset(torch.utils.data.Dataset):
...
@@ -141,7 +141,12 @@ class GPT2Dataset(torch.utils.data.Dataset):
def
_build_index_mappings
(
name
,
data_prefix
,
documents
,
sizes
,
def
_build_index_mappings
(
name
,
data_prefix
,
documents
,
sizes
,
num_samples
,
seq_length
,
seed
):
num_samples
,
seq_length
,
seed
):
"""doc-idx, sample-idx, and shuffle-idx."""
"""Build doc-idx, sample-idx, and shuffle-idx.
doc-idx: is an array (ordered) of documents to be used in training.
sample-idx: is the start document index and document offset for each
training sample.
shuffle-idx: maps the sample index into a random index into sample-idx.
"""
# Number of tokens in each epoch and number of required epochs.
# Number of tokens in each epoch and number of required epochs.
tokens_per_epoch
=
_num_tokens
(
documents
,
sizes
)
tokens_per_epoch
=
_num_tokens
(
documents
,
sizes
)
num_epochs
=
_num_epochs
(
tokens_per_epoch
,
seq_length
,
num_samples
)
num_epochs
=
_num_epochs
(
tokens_per_epoch
,
seq_length
,
num_samples
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment