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
577b4657
Commit
577b4657
authored
Sep 29, 2020
by
Mohammad Shoeybi
Browse files
Merge branch 'main_megatron_cntrl' into 'main'
Text generation fixes See merge request ADLR/megatron-lm!137
parents
4bf923d5
826d2452
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
megatron/text_generation_utils.py
megatron/text_generation_utils.py
+2
-0
tools/generate_samples_gpt2.py
tools/generate_samples_gpt2.py
+1
-1
No files found.
megatron/text_generation_utils.py
View file @
577b4657
...
@@ -97,6 +97,8 @@ def generate_samples_input_from_file(model):
...
@@ -97,6 +97,8 @@ def generate_samples_input_from_file(model):
sample_output_file
=
args
.
sample_input_file
+
".out"
sample_output_file
=
args
.
sample_input_file
+
".out"
print
(
'could not find `sample-output-file`, setting '
print
(
'could not find `sample-output-file`, setting '
'it to {}'
.
format
(
sample_output_file
))
'it to {}'
.
format
(
sample_output_file
))
else
:
sample_output_file
=
args
.
sample_output_file
fname_out
=
open
(
sample_output_file
,
"w+"
)
fname_out
=
open
(
sample_output_file
,
"w+"
)
context_count
=
0
context_count
=
0
...
...
tools/generate_samples_gpt2.py
View file @
577b4657
...
@@ -87,7 +87,7 @@ def main():
...
@@ -87,7 +87,7 @@ def main():
# Generate samples.
# Generate samples.
if
args
.
num_samples
==
0
:
if
args
.
num_samples
==
0
:
args
.
batch_size
=
1
args
.
batch_size
=
1
if
args
.
sample_input_file
!=
""
:
if
args
.
sample_input_file
!=
None
:
generate_samples_input_from_file
(
model
)
generate_samples_input_from_file
(
model
)
else
:
else
:
generate_samples_interactive
(
model
)
generate_samples_interactive
(
model
)
...
...
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