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
chenpangpang
ComfyUI
Commits
c24f8973
"git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "0ee2cb793e530c2e2aed564353ef3f47c80f6949"
Commit
c24f8973
authored
Jul 31, 2024
by
comfyanonymous
Browse files
Fix to get fp8 working on T5 base.
parent
a5991a7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
comfy/text_encoders/t5.py
comfy/text_encoders/t5.py
+2
-0
No files found.
comfy/text_encoders/t5.py
View file @
c24f8973
...
@@ -236,4 +236,6 @@ class T5(torch.nn.Module):
...
@@ -236,4 +236,6 @@ class T5(torch.nn.Module):
def
forward
(
self
,
input_ids
,
*
args
,
**
kwargs
):
def
forward
(
self
,
input_ids
,
*
args
,
**
kwargs
):
x
=
self
.
shared
(
input_ids
,
out_dtype
=
kwargs
.
get
(
"dtype"
,
torch
.
float32
))
x
=
self
.
shared
(
input_ids
,
out_dtype
=
kwargs
.
get
(
"dtype"
,
torch
.
float32
))
if
self
.
dtype
not
in
[
torch
.
float32
,
torch
.
float16
,
torch
.
bfloat16
]:
x
=
torch
.
nan_to_num
(
x
)
#Fix for fp8 T5 base
return
self
.
encoder
(
x
,
*
args
,
**
kwargs
)
return
self
.
encoder
(
x
,
*
args
,
**
kwargs
)
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