These scripts perform pipeline pruning on the classification model (XLMRobertaForSequenceClassification
) and evaluate the performance.
We use a subset of XNLI English training set as the vocabulary file.
Download the fine-tuned model or train your own model on PAWS-X dataset, and save the files to ../models/xlmr_pawsx
.
Download link: * Google Drive * Hugging Face Models
- Pruning with the textpruner-CLI tool:
bash pipeline_pruning.sh
- Pruning with the python script:
MODEL_PATH=../models/xlmr_pawsx
VOCABULARY_FILE=../datasets/xnli/en.tsv
python pipeline_pruning.py $MODEL_PATH $VOCABULARY_FILE
- Evaluate the model:
Set $PRUNED_MODEL_PATH
to the directory where the pruned model is stored.
python measure_performance.py $PRUNED_MODEL_PATH