Add script to convert T5X T5 (v1.0 and v1.1) checkpoints to PyTorch#20801
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
ff2c4af to
f342f24
Compare
|
I could use some clarification on the following: I'm missing a configuration option for T5 for the 1.0/original T5 checkpoints to have an Currently there is |
patrickvonplaten
left a comment
There was a problem hiding this comment.
Thanks a lot for adding this @bastings
|
Hey @bastings, when there is no |
ArthurZucker
left a comment
There was a problem hiding this comment.
It's very clean, thanks a lot for the addition.
sanchit-gandhi
left a comment
There was a problem hiding this comment.
Very cool PR @bastings! Thanks for the addition! Do you have a set of example args I could use just to try the script out once for myself? Thanks! 🙌
a3c1dd9 to
0d9d0af
Compare
ea37c40 to
c529472
Compare
c529472 to
6043de3
Compare
|
I added the instructions to the top docstring. Maybe it's ready? :-) |
|
A last nit and we can merge! Thanks a lot for bearing with me 😄 |
|
Thanks! Committed your suggestion :) |
|
Once the quality tests are green (requires |
|
Oh looks like the suggestion made it fail ;) |
|
Ah, sorry then ahha, I guess the |
0f279bb to
7032ed3
Compare
Fixed! :) |
…uggingface#20801) * Add script to convert T5X T5 (v1.0 and v1.1) checkpoints to PyTorch * Remove unnecessary check and update docstring * Format docstring * Fix whitespace in docstring
…uggingface#20801) * Add script to convert T5X T5 (v1.0 and v1.1) checkpoints to PyTorch * Remove unnecessary check and update docstring * Format docstring * Fix whitespace in docstring
What does this PR do?
Adds a script that can convert Google T5X (Flax) T5 and T5-v1.1 checkpoints into PyTorch checkpoints.
This allows users to convert non-standard checkpoints that have been trained with T5X and use them with the Transformers library in PyTorch.
Usage:
gsutil, install according to https://cloud.google.com/storage/docs/gsutil_installgsutil -m cp -r gs://t5-data/pretrained_models/t5x/t5_1_1_small $HOME/config.jsonfor the downloaded checkpoint. Often one already exists, e.g. here we can use https://huggingface.co/google/t5-v1_1-small/blob/main/config.jsonpython3 convert_t5x_checkpoint_to_pytorch.py --t5x_checkpoint_path=$HOME/t5_1_1_small --config_file=config.json --pytorch_dump_path=$HOME/t5_1_1_small_ptBefore submitting
Pull Request section?
to it if that's the case. Discussed with @thomwolf .
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@patrickvonplaten
@sanchit-gandhi
@ArthurZucker
@younesbelkada