Commit bda18166 authored by André Susano Pinto's avatar André Susano Pinto Committed by A. Unique TensorFlower
Browse files

Create output directories when converting bert checkpoint.

PiperOrigin-RevId: 323827690
parent 855d29db
...@@ -73,6 +73,7 @@ def _create_bert_model(cfg): ...@@ -73,6 +73,7 @@ def _create_bert_model(cfg):
def convert_checkpoint(bert_config, output_path, v1_checkpoint): def convert_checkpoint(bert_config, output_path, v1_checkpoint):
"""Converts a V1 checkpoint into an OO V2 checkpoint.""" """Converts a V1 checkpoint into an OO V2 checkpoint."""
output_dir, _ = os.path.split(output_path) output_dir, _ = os.path.split(output_path)
tf.io.gfile.makedirs(output_dir)
# Create a temporary V1 name-converted checkpoint in the output directory. # Create a temporary V1 name-converted checkpoint in the output directory.
temporary_checkpoint_dir = os.path.join(output_dir, "temp_v1") temporary_checkpoint_dir = os.path.join(output_dir, "temp_v1")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment