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
99158e75
Commit
99158e75
authored
Sep 20, 2025
by
gushiqiao
Committed by
GitHub
Sep 20, 2025
Browse files
[Fix] Fix adapter weights distribute load bug (#320)
parent
0fc763de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
lightx2v/models/networks/wan/audio_model.py
lightx2v/models/networks/wan/audio_model.py
+4
-3
No files found.
lightx2v/models/networks/wan/audio_model.py
View file @
99158e75
...
...
@@ -40,9 +40,10 @@ class WanAudioModel(WanModel):
adapter_offload
=
self
.
config
.
get
(
"cpu_offload"
,
False
)
load_from_rank0
=
self
.
config
.
get
(
"load_from_rank0"
,
False
)
self
.
adapter_weights_dict
=
load_weights
(
self
.
config
.
adapter_model_path
,
cpu_offload
=
adapter_offload
,
remove_key
=
"audio"
,
load_from_rank0
=
load_from_rank0
)
if
not
dist
.
is_initialized
()
and
not
adapter_offload
:
for
key
in
self
.
adapter_weights_dict
:
self
.
adapter_weights_dict
[
key
]
=
self
.
adapter_weights_dict
[
key
].
cuda
()
if
not
adapter_offload
:
if
not
dist
.
is_initialized
()
or
not
load_from_rank0
:
for
key
in
self
.
adapter_weights_dict
:
self
.
adapter_weights_dict
[
key
]
=
self
.
adapter_weights_dict
[
key
].
cuda
()
def
_init_infer_class
(
self
):
super
().
_init_infer_class
()
...
...
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