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
7a0710ec
Commit
7a0710ec
authored
May 18, 2021
by
Mostofa Patwary
Browse files
before cleaning the comments
parent
4a09bb3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
8 deletions
+0
-8
megatron/data/biencoder_dataset_utils.py
megatron/data/biencoder_dataset_utils.py
+0
-6
tasks/orqa/supervised/data.py
tasks/orqa/supervised/data.py
+0
-2
No files found.
megatron/data/biencoder_dataset_utils.py
View file @
7a0710ec
...
@@ -20,12 +20,6 @@ def make_attention_mask(source_block, target_block):
...
@@ -20,12 +20,6 @@ def make_attention_mask(source_block, target_block):
# (source_length, target_length)
# (source_length, target_length)
return
mask
return
mask
def
make_history_mask
(
block
):
length
=
block
.
shape
[
0
]
arange
=
np
.
arange
(
length
)
history_mask
=
(
arange
[
None
,
]
<=
arange
[:,
None
])
history_mask
=
history_mask
.
astype
(
np
.
int64
)
return
history_mask
def
get_one_epoch_dataloader
(
dataset
,
micro_batch_size
=
None
):
def
get_one_epoch_dataloader
(
dataset
,
micro_batch_size
=
None
):
"""Specifically one epoch to be used in an indexing job."""
"""Specifically one epoch to be used in an indexing job."""
...
...
tasks/orqa/supervised/data.py
View file @
7a0710ec
...
@@ -25,8 +25,6 @@ from torch.utils.data import Dataset
...
@@ -25,8 +25,6 @@ from torch.utils.data import Dataset
from
megatron
import
print_rank_0
,
get_args
from
megatron
import
print_rank_0
,
get_args
from
megatron.data.biencoder_dataset_utils
import
make_attention_mask
from
megatron.data.biencoder_dataset_utils
import
make_attention_mask
from
megatron.data.biencoder_dataset_utils
import
make_history_mask
def
build_token_types_from_context_list
(
ctx_list
,
tokenizer
,
max_seq_length
):
def
build_token_types_from_context_list
(
ctx_list
,
tokenizer
,
max_seq_length
):
ctx_id_list
,
ctx_types_list
=
[],
[]
ctx_id_list
,
ctx_types_list
=
[],
[]
...
...
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