diff --git a/scripts/conversion_toolkits/convert_fairseq_xlmr.py b/scripts/conversion_toolkits/convert_fairseq_xlmr.py index 469bb94d94..4b3ec74da6 100644 --- a/scripts/conversion_toolkits/convert_fairseq_xlmr.py +++ b/scripts/conversion_toolkits/convert_fairseq_xlmr.py @@ -87,7 +87,7 @@ def convert_fairseq_model(args): checkpoint_file='model.pt') vocab_size = convert_vocab(args, fairseq_xlmr) - gluon_cfg = convert_config(fairseq_xlmr.cfg.model, vocab_size, + gluon_cfg = convert_config(fairseq_xlmr.args, vocab_size, XLMRModel.get_cfg().clone()) with open(os.path.join(args.save_dir, 'model.yml'), 'w') as of: of.write(gluon_cfg.dump()) diff --git a/scripts/conversion_toolkits/convert_xlmr.sh b/scripts/conversion_toolkits/convert_xlmr.sh index 20fefff7a6..a10fd4d746 100644 --- a/scripts/conversion_toolkits/convert_xlmr.sh +++ b/scripts/conversion_toolkits/convert_xlmr.sh @@ -1,4 +1,4 @@ -python3 -m pip install git+https://github.com/pytorch/fairseq.git@master --upgrade --user +python3 -m pip install fairseq==0.10.1 --upgrade --user for model in base large do mkdir xlmr_${model}