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
SIYIXNI
vllm
Commits
2a2c135b
"examples/community/lpw_stable_diffusion_xl.py" did not exist on "ad8f985e81d0e0bac0375cd81b909987e8b2a7f9"
Unverified
Commit
2a2c135b
authored
Nov 17, 2023
by
twaka
Committed by
GitHub
Nov 16, 2023
Browse files
Fix loading error when safetensors contains empty tensor (#1687)
parent
65ea2ddf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vllm/model_executor/weight_utils.py
vllm/model_executor/weight_utils.py
+6
-1
No files found.
vllm/model_executor/weight_utils.py
View file @
2a2c135b
...
@@ -258,7 +258,12 @@ def convert_pyslice_to_tensor(x: Any) -> torch.Tensor:
...
@@ -258,7 +258,12 @@ def convert_pyslice_to_tensor(x: Any) -> torch.Tensor:
tensor first.
tensor first.
"""
"""
if
not
isinstance
(
x
,
torch
.
Tensor
):
if
not
isinstance
(
x
,
torch
.
Tensor
):
try
:
x
=
x
[:]
x
=
x
[:]
except
IndexError
:
# IndexError happens when the tensor is empty.
# transformer.h.0.attn.masked_bias is empty in some gpt2 models.
return
torch
.
Tensor
()
return
x
return
x
...
...
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