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
1d391bba
Commit
1d391bba
authored
Feb 10, 2022
by
rprenger
Browse files
Addressing comments
parent
b0c824d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
megatron/static/index.html
megatron/static/index.html
+15
-0
megatron/text_generation/generation.py
megatron/text_generation/generation.py
+2
-0
No files found.
megatron/static/index.html
View file @
1d391bba
<!-- coding=utf-8-->
<!-- Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.-->
<!---->
<!-- Licensed under the Apache License, Version 2.0 (the "License");-->
<!-- you may not use this file except in compliance with the License.-->
<!-- You may obtain a copy of the License at-->
<!---->
<!-- http://www.apache.org/licenses/LICENSE-2.0-->
<!---->
<!-- Unless required by applicable law or agreed to in writing, software-->
<!-- distributed under the License is distributed on an "AS IS" BASIS,-->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-->
<!-- See the License for the specific language governing permissions and-->
<!-- limitations under the License.-->
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
...
...
megatron/text_generation/generation.py
View file @
1d391bba
...
@@ -234,6 +234,8 @@ def generate_tokens_probs_and_return_on_first_stage(
...
@@ -234,6 +234,8 @@ def generate_tokens_probs_and_return_on_first_stage(
# Check if all the sequences have hit the termination_id.
# Check if all the sequences have hit the termination_id.
done
=
None
done
=
None
if
mpu
.
is_pipeline_last_stage
():
if
mpu
.
is_pipeline_last_stage
():
# TODO(rprenger) These stopping methods are tokenizer dependent
# instead tokenization should be in the inference loop so stop sequences can be used
if
stop_on_double_eol
:
if
stop_on_double_eol
:
hit_double_eol
=
(
new_sample
==
628
).
byte
()
&
started
.
byte
()
hit_double_eol
=
(
new_sample
==
628
).
byte
()
&
started
.
byte
()
hit_two_eols
=
(
new_sample
==
198
).
byte
()
&
(
tokens
[:,
context_length
-
1
]
==
198
).
byte
()
&
started
.
byte
()
hit_two_eols
=
(
new_sample
==
198
).
byte
()
&
(
tokens
[:,
context_length
-
1
]
==
198
).
byte
()
&
started
.
byte
()
...
...
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