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
8694c7b0
Commit
8694c7b0
authored
Aug 25, 2021
by
rprenger
Browse files
Found a bug. If you don't make this change and you ask for 1 token you get 2 etc.
parent
055a673e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
megatron/text_generation_utils.py
megatron/text_generation_utils.py
+1
-1
No files found.
megatron/text_generation_utils.py
View file @
8694c7b0
...
@@ -241,7 +241,7 @@ def sample_sequence_batch(model, context_tokens, context_lengths,
...
@@ -241,7 +241,7 @@ def sample_sequence_batch(model, context_tokens, context_lengths,
lengths
=
torch
.
ones
([
batch_size
]).
long
().
cuda
()
*
maxlen
lengths
=
torch
.
ones
([
batch_size
]).
long
().
cuda
()
*
maxlen
while
context_length
<
=
(
maxlen
)
:
while
context_length
<
maxlen
:
types2use
=
None
types2use
=
None
if
counter
==
0
:
if
counter
==
0
:
tokens2use
=
tokens
[:,
:
context_length
]
tokens2use
=
tokens
[:,
:
context_length
]
...
...
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