From cb73ab5a385126dadff2804cbd1672bdeedc64c4 Mon Sep 17 00:00:00 2001 From: Yusuke Mori Date: Tue, 26 Jan 2021 17:37:57 +0900 Subject: [PATCH] Fix broken links in the converting tf ckpt document (#9791) * Fix broken links in the converting tf ckpt document * Update docs/source/converting_tensorflow_models.rst Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Reflect the review Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> --- docs/source/converting_tensorflow_models.rst | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/source/converting_tensorflow_models.rst b/docs/source/converting_tensorflow_models.rst index cfc057bc82b..e04ccdee2a2 100644 --- a/docs/source/converting_tensorflow_models.rst +++ b/docs/source/converting_tensorflow_models.rst @@ -28,17 +28,13 @@ BERT You can convert any TensorFlow checkpoint for BERT (in particular `the pre-trained models released by Google `_\ ) in a PyTorch save file by using the :prefix_link:`convert_bert_original_tf_checkpoint_to_pytorch.py -` script. +` script. This CLI takes as input a TensorFlow checkpoint (three files starting with ``bert_model.ckpt``\ ) and the associated configuration file (\ ``bert_config.json``\ ), and creates a PyTorch model for this configuration, loads the weights from the TensorFlow checkpoint in the PyTorch model and saves the resulting model in a standard PyTorch save file that -can be imported using ``torch.load()`` (see examples in `run_bert_extract_features.py -`_\ , -`run_bert_classifier.py -`_ and -`run_bert_squad.py `_\ -). +can be imported using ``from_pretrained()`` (see example in :doc:`quicktour` , `run_glue.py +`_\ ). You only need to run this conversion script **once** to get a PyTorch model. You can then disregard the TensorFlow checkpoint (the three files starting with ``bert_model.ckpt``\ ) but be sure to keep the configuration file (\ @@ -66,7 +62,7 @@ ALBERT Convert TensorFlow model checkpoints of ALBERT to PyTorch using the :prefix_link:`convert_albert_original_tf_checkpoint_to_pytorch.py -` script. +` script. The CLI takes as input a TensorFlow checkpoint (three files starting with ``model.ckpt-best``\ ) and the accompanying configuration file (\ ``albert_config.json``\ ), then creates and saves a PyTorch model. To run this conversion you