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
44bfcb32
Commit
44bfcb32
authored
Apr 19, 2021
by
Mostofa Patwary
Browse files
modified the params
parent
045959cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
10 deletions
+1
-10
megatron/text_generation_utils.py
megatron/text_generation_utils.py
+1
-10
No files found.
megatron/text_generation_utils.py
View file @
44bfcb32
...
...
@@ -190,7 +190,7 @@ def generate_samples_input_from_file(model):
raw_text
=
None
context_count
+=
1
def
generate_samples_eval
(
model
,
context
,
max_gen_length
,
eos_token_id
,
do_sample
):
def
generate_samples_eval
(
model
,
context
,
max_gen_length
,
eos_token_id
):
# Generate samples for lm evaluation
# NEED TO THINK ABOUT eos token
...
...
@@ -202,17 +202,8 @@ def generate_samples_eval(model, context, max_gen_length, eos_token_id, do_sampl
context_tokens
=
tokenizer
.
tokenize
(
context
)
args
.
out_seq_length
=
max_gen_length
+
len
(
context_tokens
)
args
.
recompute
=
True
#set this default value
args
.
eos_id
=
eos_token_id
if
not
do_sample
:
args
.
greedy
=
True
else
:
# set similar to huggngface
args
.
top_p
=
1.0
args
.
temperature
=
1.0
args
.
top_k
=
50
with
torch
.
no_grad
():
token_stream
=
get_token_stream
(
model
,
[
context_tokens
])
for
counter
,
decode_tokens
in
enumerate
(
token_stream
):
...
...
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