Load original T5 checkpoints

I want to load one of the original T5 checkpoints. How can I do that? I found an answer referring to a convert_t5_original_tf_checkpoint_to_pytorch.py which does not seem to exist.

…they are moved to transformers/src/transformers/models/t5. But it requires a config.json which is not part of the original files (in gs://t5-data/pretrained_models/small).

1 Like

…and the solution: here you can find all related files (most importantly config.json but also already converted model files, model card, etc.): t5-small · Hugging Face. And an example workflow:

mkdir t5
gsutil -m cp -r gs://t5-data/pretrained_models/small t5
python ~/transformers/src/transformers/models/t5/convert_t5_original_tf_checkpoint_to_pytorch.py --tf_checkpoint_path t5/small/model.ckpt-1000000 --pytorch_dump_path t5-small-pt --config_file t5/small_config.json
1 Like