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
chenpangpang
transformers
Commits
e3e16ddc
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "af1ee9e648e644aae45c5250a46d4c25a4e0d04d"
Commit
e3e16ddc
authored
Mar 25, 2024
by
Arthur Zucker
Browse files
[`revert commit`] revert
00a09ed4
parent
00a09ed4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+1
-3
No files found.
src/transformers/modeling_utils.py
View file @
e3e16ddc
...
...
@@ -600,9 +600,7 @@ def _load_state_dict_into_model(model_to_load, state_dict, start_prefix):
# so we need to apply the function recursively.
def
load
(
module
:
nn
.
Module
,
state_dict
,
prefix
=
""
):
local_metadata
=
{}
if
metadata
is
None
else
metadata
.
get
(
prefix
[:
-
1
],
{})
unexpected_keys
=
[]
missing_keys
=
[]
args
=
(
state_dict
,
prefix
,
local_metadata
,
True
,
missing_keys
,
unexpected_keys
,
error_msgs
)
args
=
(
state_dict
,
prefix
,
local_metadata
,
True
,
[],
[],
error_msgs
)
# Parameters of module and children will start with prefix. We can exit early if there are none in this
# state_dict
if
len
([
key
for
key
in
state_dict
if
key
.
startswith
(
prefix
)])
>
0
:
...
...
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