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
a3770921
Commit
a3770921
authored
Oct 18, 2021
by
rprenger
Browse files
Fixing logic in server accepting tokens_to_generate=0
parent
87d08f4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
megatron/text_generation_server.py
megatron/text_generation_server.py
+3
-2
No files found.
megatron/text_generation_server.py
View file @
a3770921
...
@@ -69,8 +69,9 @@ class MegatronGenerate(Resource):
...
@@ -69,8 +69,9 @@ class MegatronGenerate(Resource):
logprobs
=
request
.
get_json
()[
"logprobs"
]
logprobs
=
request
.
get_json
()[
"logprobs"
]
if
not
isinstance
(
logprobs
,
bool
):
if
not
isinstance
(
logprobs
,
bool
):
return
"logprobs must be a boolean value"
return
"logprobs must be a boolean value"
if
just_score
and
not
logprobs
:
return
"tokens_to_generate=0 implies logprobs=True"
if
just_score
and
not
logprobs
:
return
"tokens_to_generate=0 implies logprobs=True"
temperature
=
1.0
temperature
=
1.0
if
"temperature"
in
request
.
get_json
():
if
"temperature"
in
request
.
get_json
():
...
...
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