Skip to content

Instantly share code, notes, and snippets.

@gchhablani
Last active October 6, 2021 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gchhablani/1f579371d0ac441c2a3cdc4815c3eebd to your computer and use it in GitHub Desktop.
Save gchhablani/1f579371d0ac441c2a3cdc4815c3eebd to your computer and use it in GitHub Desktop.
sudo apt install g++
pip install git+https://github.com/pytorch/fairseq.git@698e3b91ffa832c286c48035bdff78238b0de8ae
git clone https://github.com/wasiahmad/PLBART
# PreTrained
## Download pre-trained checkpoint
cd PLBART/pretrain
bash download.sh
## Copy to ckpt
mkdir ../plbart_orig_pretrained_ckpt
cp checkpoint_11_100000.pt ../plbart_orig_pretrained_ckpt/
cp ../sentencepiece/sentencepiece.bpe.model ../plbart_orig_pretrained_ckpt/
cp ../sentencepiece/dict.txt ../plbart_orig_pretrained_ckpt/
## Use the MBart conversion script to get HF PLBart checkpoint
# Use the PLBartConfig to store the pre-trained model config
python src/transformers/models/plbart/convert_plbart_original_checkpoint_to_torch.py PLBART/plbart_orig_pretrained_ckpt/model.pt plbart-base --hf_config plbart-base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment