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
321c31c9
Unverified
Commit
321c31c9
authored
Oct 15, 2025
by
sandy
Committed by
GitHub
Oct 15, 2025
Browse files
[Fix]prevent ZeroDivisionError when chunk_size is 0 (#367)
parent
d9795972
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tools/convert/converter.py
tools/convert/converter.py
+1
-1
No files found.
tools/convert/converter.py
View file @
321c31c9
...
@@ -567,7 +567,7 @@ def convert_weights(args):
...
@@ -567,7 +567,7 @@ def convert_weights(args):
current_chunk
=
{}
current_chunk
=
{}
for
idx
,
(
k
,
v
)
in
tqdm
(
enumerate
(
converted_weights
.
items
()),
desc
=
"Saving chunks"
):
for
idx
,
(
k
,
v
)
in
tqdm
(
enumerate
(
converted_weights
.
items
()),
desc
=
"Saving chunks"
):
current_chunk
[
k
]
=
v
current_chunk
[
k
]
=
v
if
(
idx
+
1
)
%
args
.
chunk_size
==
0
and
args
.
chunk_size
>
0
:
if
args
.
chunk_size
>
0
and
(
idx
+
1
)
%
args
.
chunk_size
==
0
:
output_filename
=
f
"
{
args
.
output_name
}
_part
{
chunk_idx
}
.safetensors"
output_filename
=
f
"
{
args
.
output_name
}
_part
{
chunk_idx
}
.safetensors"
output_path
=
os
.
path
.
join
(
args
.
output
,
output_filename
)
output_path
=
os
.
path
.
join
(
args
.
output
,
output_filename
)
logger
.
info
(
f
"Saving chunk to:
{
output_path
}
"
)
logger
.
info
(
f
"Saving chunk to:
{
output_path
}
"
)
...
...
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