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
text-generation-inference
Commits
686cc667
Unverified
Commit
686cc667
authored
Dec 30, 2022
by
Nick Hill
Committed by
GitHub
Dec 30, 2022
Browse files
fix(server): Check for device type correctly when determining initial padding (#16)
AFAIK there is no torch device type called "gpu".
parent
611e21cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
server/text_generation/models/causal_lm.py
server/text_generation/models/causal_lm.py
+1
-1
server/text_generation/models/seq2seq_lm.py
server/text_generation/models/seq2seq_lm.py
+1
-1
No files found.
server/text_generation/models/causal_lm.py
View file @
686cc667
...
...
@@ -65,7 +65,7 @@ class CausalLMBatch:
)
all_logprobs
.
append
(
None
)
pad_to_multiple_of
=
8
if
"gpu"
in
str
(
device
)
else
None
pad_to_multiple_of
=
8
if
device
.
type
==
"cuda"
else
None
tokenized_inputs
=
tokenizer
(
inputs
,
return_tensors
=
"pt"
,
...
...
server/text_generation/models/seq2seq_lm.py
View file @
686cc667
...
...
@@ -77,7 +77,7 @@ class Seq2SeqLMBatch:
decoder_logprobs
.
append
(
None
)
# Tokenize batch
pad_to_multiple_of
=
8
if
"gpu"
in
str
(
device
)
else
None
pad_to_multiple_of
=
8
if
device
.
type
==
"cuda"
else
None
tokenized_inputs
=
tokenizer
(
inputs
,
return_tensors
=
"pt"
,
...
...
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