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
xuwx1
LightX2V
Commits
dbfa688b
Commit
dbfa688b
authored
May 07, 2025
by
helloyongyang
Browse files
Fix weight loading without quant
parent
420fec7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
lightx2v/common/ops/mm/mm_weight.py
lightx2v/common/ops/mm/mm_weight.py
+1
-1
lightx2v/models/networks/hunyuan/model.py
lightx2v/models/networks/hunyuan/model.py
+1
-1
lightx2v/models/networks/wan/model.py
lightx2v/models/networks/wan/model.py
+1
-1
No files found.
lightx2v/common/ops/mm/mm_weight.py
View file @
dbfa688b
...
@@ -64,7 +64,7 @@ class MMWeight(MMWeightTemplate):
...
@@ -64,7 +64,7 @@ class MMWeight(MMWeightTemplate):
super
().
__init__
(
weight_name
,
bias_name
)
super
().
__init__
(
weight_name
,
bias_name
)
def
load
(
self
,
weight_dict
):
def
load
(
self
,
weight_dict
):
if
GET_RUNNING_FLAG
()
==
"save_naive_quant"
or
self
.
config
.
get
(
"weight_auto_quant"
,
False
):
if
GET_RUNNING_FLAG
()
==
"save_naive_quant"
or
self
.
config
.
get
(
"weight_auto_quant"
,
False
)
or
self
.
config
.
get
(
"mm_type"
,
"Default"
)
==
"Default"
:
self
.
weight
=
weight_dict
[
self
.
weight_name
].
t
().
cuda
()
self
.
weight
=
weight_dict
[
self
.
weight_name
].
t
().
cuda
()
self
.
bias
=
weight_dict
[
self
.
bias_name
].
cuda
()
if
self
.
bias_name
is
not
None
else
None
self
.
bias
=
weight_dict
[
self
.
bias_name
].
cuda
()
if
self
.
bias_name
is
not
None
else
None
else
:
else
:
...
...
lightx2v/models/networks/hunyuan/model.py
View file @
dbfa688b
...
@@ -73,7 +73,7 @@ class HunyuanModel:
...
@@ -73,7 +73,7 @@ class HunyuanModel:
return
weight_dict
return
weight_dict
def
_init_weights
(
self
):
def
_init_weights
(
self
):
if
GET_RUNNING_FLAG
()
==
"save_naive_quant"
or
self
.
config
[
"mm_config"
].
get
(
"weight_auto_quant"
,
False
):
if
GET_RUNNING_FLAG
()
==
"save_naive_quant"
or
self
.
config
[
"mm_config"
].
get
(
"weight_auto_quant"
,
False
)
or
self
.
config
[
"mm_config"
].
get
(
"mm_type"
,
"Default"
)
==
"Default"
:
weight_dict
=
self
.
_load_ckpt
()
weight_dict
=
self
.
_load_ckpt
()
else
:
else
:
weight_dict
=
self
.
_load_ckpt_quant_model
()
weight_dict
=
self
.
_load_ckpt_quant_model
()
...
...
lightx2v/models/networks/wan/model.py
View file @
dbfa688b
...
@@ -90,7 +90,7 @@ class WanModel:
...
@@ -90,7 +90,7 @@ class WanModel:
def
_init_weights
(
self
,
weight_dict
=
None
):
def
_init_weights
(
self
,
weight_dict
=
None
):
if
weight_dict
is
None
:
if
weight_dict
is
None
:
if
GET_RUNNING_FLAG
()
==
"save_naive_quant"
or
self
.
config
[
"mm_config"
].
get
(
"weight_auto_quant"
,
False
):
if
GET_RUNNING_FLAG
()
==
"save_naive_quant"
or
self
.
config
[
"mm_config"
].
get
(
"weight_auto_quant"
,
False
)
or
self
.
config
[
"mm_config"
].
get
(
"mm_type"
,
"Default"
)
==
"Default"
:
self
.
original_weight_dict
=
self
.
_load_ckpt
()
self
.
original_weight_dict
=
self
.
_load_ckpt
()
else
:
else
:
self
.
original_weight_dict
=
self
.
_load_ckpt_quant_model
()
self
.
original_weight_dict
=
self
.
_load_ckpt_quant_model
()
...
...
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