Open zhongxiangboy opened 3 years ago
Hi there. This code is for fine-tuning the weights of the original pretrained BART model. So once you download the pretrained model from fairseq's server https://dl.fbaipublicfiles.com/fairseq/models/bart.large.tar.gz, you need to provide that model (named model.pt) to the training script, which does the fine-tuning procedure. You can use your own path though, as long as it points to the pretrained weights. If you want to pretrain the model from scratch with your own data, you will have to look at fairseq for their instructions on how to do it.
BART_CONFIG=path/to/your/config CHECKPOINT_DIR=path/to/save/checkpoints
CUDA_VISIBLE_DEVICES=0 python -m bart.train $BART_CONFIG/bart-bin \ --save-dir=$CHECKPOINT_DIR \ --restore-file bart/bart.large/model.pt \ --max-tokens 1024 \ --truncate-source \ --task translation \ --source-lang source --target-lang target \
Thanks for your excellent work 👍 ~ I'm a bit confused about the parameter of --restore-file ? Do I need to re-specify it when I train with my own data? I noticed that it points to a model.pt file, does this file have anything to do with my own trained model file? Will it affect my inferences?