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
4f4c9c16
Unverified
Commit
4f4c9c16
authored
May 23, 2023
by
OlivierDehaene
Committed by
GitHub
May 23, 2023
Browse files
fix(server): t5 cannot run in f16 (#356)
Fix #349
parent
91d9beec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
server/text_generation_server/models/t5.py
server/text_generation_server/models/t5.py
+1
-1
No files found.
server/text_generation_server/models/t5.py
View file @
4f4c9c16
...
@@ -40,7 +40,7 @@ class T5Sharded(Seq2SeqLM):
...
@@ -40,7 +40,7 @@ class T5Sharded(Seq2SeqLM):
self
.
process_group
,
rank
,
world_size
=
initialize_torch_distributed
()
self
.
process_group
,
rank
,
world_size
=
initialize_torch_distributed
()
if
torch
.
cuda
.
is_available
():
if
torch
.
cuda
.
is_available
():
device
=
torch
.
device
(
f
"cuda:
{
rank
}
"
)
device
=
torch
.
device
(
f
"cuda:
{
rank
}
"
)
dtype
=
torch
.
float16
dtype
=
torch
.
b
float16
if
torch
.
cuda
.
is_bf16_supported
()
else
torch
.
float32
else
:
else
:
device
=
torch
.
device
(
"cpu"
)
device
=
torch
.
device
(
"cpu"
)
dtype
=
torch
.
float32
dtype
=
torch
.
float32
...
...
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