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
85295621
Unverified
Commit
85295621
authored
Mar 29, 2022
by
Suraj Patil
Committed by
GitHub
Mar 29, 2022
Browse files
Fix blenderbot conversion script (#16472)
parent
c85547af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/transformers/models/blenderbot/convert_blenderbot_original_pytorch_checkpoint_to_pytorch.py
...vert_blenderbot_original_pytorch_checkpoint_to_pytorch.py
+3
-3
No files found.
src/transformers/models/blenderbot/convert_blenderbot_original_pytorch_checkpoint_to_pytorch.py
View file @
85295621
...
...
@@ -18,7 +18,7 @@ import argparse
import
torch
from
transformers
import
B
ar
tConfig
,
B
ar
tForConditionalGeneration
from
transformers
import
B
lenderbo
tConfig
,
B
lenderbo
tForConditionalGeneration
from
transformers.utils
import
logging
...
...
@@ -81,8 +81,8 @@ def convert_parlai_checkpoint(checkpoint_path, pytorch_dump_folder_path, config_
"""
model
=
torch
.
load
(
checkpoint_path
,
map_location
=
"cpu"
)
sd
=
model
[
"model"
]
cfg
=
B
ar
tConfig
.
from_json_file
(
config_json_path
)
m
=
B
ar
tForConditionalGeneration
(
cfg
)
cfg
=
B
lenderbo
tConfig
.
from_json_file
(
config_json_path
)
m
=
B
lenderbo
tForConditionalGeneration
(
cfg
)
valid_keys
=
m
.
model
.
state_dict
().
keys
()
failures
=
[]
mapping
=
{}
...
...
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