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
33cb2115
Unverified
Commit
33cb2115
authored
Apr 07, 2022
by
Stefan Schweter
Committed by
GitHub
Apr 07, 2022
Browse files
bert: properly mention deprecation of TF2 conversion script (#16171)
parent
af14c619
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
src/transformers/models/bert/convert_bert_original_tf2_checkpoint_to_pytorch.py
...s/bert/convert_bert_original_tf2_checkpoint_to_pytorch.py
+5
-2
No files found.
src/transformers/models/bert/convert_bert_original_tf2_checkpoint_to_pytorch.py
View file @
33cb2115
...
...
@@ -13,13 +13,16 @@
# limitations under the License.
"""
This script can be used to convert a head-less TF2.x Bert model to PyTorch, as published on the official
GitHub:
https://github.com/tensorflow/models/tree/
master
/official/nlp/bert
This script can be used to convert a head-less TF2.x Bert model to PyTorch, as published on the official
(now
deprecated) GitHub:
https://github.com/tensorflow/models/tree/
v2.3.0
/official/nlp/bert
TF2.x uses different variable names from the original BERT (TF 1.4) implementation. The script re-maps the TF2.x Bert
weight names to the original names, so the model can be imported with Huggingface/transformer.
You may adapt this script to include classification/MLM/NSP/etc. heads.
Note: This script is only working with an older version of the TensorFlow models repository (<= v2.3.0).
Models trained with never versions are not compatible with this script.
"""
import
argparse
import
os
...
...
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