|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -d "src/transformers" ]; then |
|
echo "Error: This script needs to be run from the top of the transformers repo" |
|
exit 1 |
|
fi |
|
|
|
mkdir data |
|
|
|
|
|
|
|
cd data |
|
gdown 'https://drive.google.com/uc?id=1j6z9fYdlUyOYsh7KJoumRlr1yHczxR5T' |
|
gdown 'https://drive.google.com/uc?id=1yT7ZjqfvUYOBXvMjeY8uGRHQFWoSo8Q5' |
|
gdown 'https://drive.google.com/uc?id=15gAzHeRUCs-QV8vHeTReMPEh1j8excNE' |
|
tar -xvzf wmt19.de-en.tar.gz |
|
tar -xvzf wmt19_deen_base_dr0.1_1.tar.gz |
|
tar -xvzf wmt19_deen_big_dr0.1_2.tar.gz |
|
cp wmt19.de-en/data-bin/dict.*.txt wmt19_deen_base_dr0.1_1 |
|
cp wmt19.de-en/data-bin/dict.*.txt wmt19_deen_big_dr0.1_2 |
|
cd - |
|
|
|
|
|
|
|
PYTHONPATH="src" python src/transformers/convert_fsmt_original_pytorch_checkpoint_to_pytorch.py --fsmt_checkpoint_path data/wmt19_deen_base_dr0.1_1/checkpoint_last3_avg.pt --pytorch_dump_folder_path data/wmt19-de-en-6-6-base |
|
|
|
PYTHONPATH="src" python src/transformers/convert_fsmt_original_pytorch_checkpoint_to_pytorch.py --fsmt_checkpoint_path data/wmt19_deen_big_dr0.1_2/checkpoint_last3_avg.pt --pytorch_dump_folder_path data/wmt19-de-en-6-6-big |
|
|
|
|
|
|
|
cd data |
|
transformers-cli upload -y wmt19-de-en-6-6-base |
|
transformers-cli upload -y wmt19-de-en-6-6-big |
|
cd - |
|
|
|
|
|
|
|
perl -le 'for $f (@ARGV) { print qq[transformers-cli upload -y $_/$f --filename $_/$f] for ("wmt19-de-en-6-6-base", "wmt19-de-en-6-6-big")}' vocab-src.json vocab-tgt.json tokenizer_config.json config.json |
|
|
|
|
|
|