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
OpenDAS
bitsandbytes
Commits
b599fdb1
Commit
b599fdb1
authored
Jun 14, 2023
by
Max Ryabinin
Browse files
Only rearrange weight if it exists
parent
c1f3f56d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+4
-1
No files found.
bitsandbytes/nn/modules.py
View file @
b599fdb1
...
@@ -307,7 +307,10 @@ class Int8Params(torch.nn.Parameter):
...
@@ -307,7 +307,10 @@ class Int8Params(torch.nn.Parameter):
def
maybe_rearrange_weight
(
state_dict
,
prefix
,
local_metadata
,
strict
,
missing_keys
,
unexpected_keys
,
error_msgs
):
def
maybe_rearrange_weight
(
state_dict
,
prefix
,
local_metadata
,
strict
,
missing_keys
,
unexpected_keys
,
error_msgs
):
weight
=
state_dict
[
f
"
{
prefix
}
weight"
]
weight
=
state_dict
.
get
(
f
"
{
prefix
}
weight"
)
if
weight
is
None
:
# if the state dict has no weights for this layer (e.g., LoRA finetuning), do nothing
return
weight_format
=
state_dict
.
pop
(
f
"
{
prefix
}
weight_format"
,
"row"
)
weight_format
=
state_dict
.
pop
(
f
"
{
prefix
}
weight_format"
,
"row"
)
if
weight_format
!=
"row"
:
if
weight_format
!=
"row"
:
...
...
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