Skip to content

Commit

Permalink
re-upload bart
Browse files Browse the repository at this point in the history
  • Loading branch information
zheyuye committed Jul 30, 2020
1 parent 516ae84 commit 0425346
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/conversion_toolkits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The testing step mentioned above are controlled by the flag `--test`, in which t
tolerance of 1e-3 between gluon model with converted weights and original tensorflow model.
In addition, we can use GPU in all converting scripts by adding `--gpu 0`.

For RoBERTa XLM-R and BART model, please instal the [fairseq](https://github.com/pytorch/fairseq#requirements-and-installation) package locally before conversion.
For RoBERTa XLM-R and BART model, please instal the [fairseq](https://github.com/pytorch/fairseq#requirements-and-installation) package locally as `pip install git+https://github.com/pytorch/fairseq.git@master`.

## BERT
Convert model from [BERT LIST](https://tfhub.dev/google/collections/bert/1).
Expand Down
7 changes: 7 additions & 0 deletions scripts/conversion_toolkits/convert_bart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
for model in base large
do
mkdir bart_${model}
wget "https://dl.fbaipublicfiles.com/fairseq/models/bart.${model}.tar.gz"
tar zxf bart.${model}.tar.gz --directory bart_${model}
python convert_fairseq_bart.py --fairseq_model_path bart_${model}/bart.${model} --test
done
4 changes: 2 additions & 2 deletions src/gluonnlp/models/bart.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ def bart_large():
'cfg': bart_base(),
'merges': 'fairseq_bart_base/gpt2-396d4d8e.merges',
'vocab': 'fairseq_bart_base/gpt2-f4dedacb.vocab',
'params': 'fairseq_bart_base/model-6dea1e11.params',
'params': 'fairseq_bart_base/model-8f4929b5.params',
'lowercase': False,
},
'fairseq_bart_large': {
'cfg': bart_large(),
'merges': 'fairseq_bart_large/gpt2-396d4d8e.merges',
'vocab': 'fairseq_bart_large/gpt2-f1335494.vocab',
'params': 'fairseq_bart_large/model-38f35552.params',
'params': 'fairseq_bart_large/model-862277b1.params',
'lowercase': False,
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/gluonnlp/models/model_zoo_checksums/bart.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fairseq_bart_base/model-6dea1e11.params 6dea1e11049f408cdd1088cd2c7e418434e1b03c 560560736
fairseq_bart_base/model-8f4929b5.params 8f4929b54f2f77619885cea9f3bd7dba51a27f38 560560748
fairseq_bart_base/gpt2-396d4d8e.merges 396d4d8ec90cb02f4d56e049e0e4add868bcd943 456318
fairseq_bart_base/model-3a06f8c8.yml 3a06f8c815fdda7c6efdb7859f7c7174895272b2 751
fairseq_bart_base/model-251bf089.yml 251bf08944d18cc29b59a4a854bdbccf601dabb5 754
fairseq_bart_base/gpt2-f4dedacb.vocab f4dedacb076b1df441c9c7398ed9acd3c19865f3 575079
fairseq_bart_large/model-38f35552.params 38f35552a8889593f8f200074244a3c8e6d52a0c 1625180950
fairseq_bart_large/model-862277b1.params 862277b1489ed95140cb63279fbd0098ef2dea90 1625180962
fairseq_bart_large/gpt2-396d4d8e.merges 396d4d8ec90cb02f4d56e049e0e4add868bcd943 456318
fairseq_bart_large/model-b52f8ac1.yml b52f8ac182573d63a18a5f14900f457531177f31 743
fairseq_bart_large/model-a2932dea.yml a2932deaf9737d95891755841fae3e388f3d698a 746
fairseq_bart_large/gpt2-f1335494.vocab f1335494f47917829e3b1d08e579ff2c3fe4fd60 558231

0 comments on commit 0425346

Please sign in to comment.