ONNX 模型库
返回模型

说明文档

BERT-large/SQuADv1.1 的联合剪枝、量化和蒸馏

环境配置

git clone https://github.com/vuiseng9/optimum-intel
cd optimum-intel
pip install -e .[openvino,nncf]

cd examples/openvino/question-answering/
pip install -r requirements.txt

pip install wandb # 可选

运行


NNCFCFG=/path/to/openvino_config.json
MASTER_PORT=<端口ID>
RUNID=<运行标识符>
OUTDIR=/path/to/saved_model

NEPOCH=30

python -m torch.distributed.launch \
    --nproc_per_node 4 \
    --master_port $MASTER_PORT \
    run_qa.py \
    --model_name_or_path bert-large-uncased-whole-word-masking \
    --dataset_name squad \
    --teacher_model_or_path bert-large-uncased-whole-word-masking-finetuned-squad \
    --distillation_weight 0.9 \
    --do_eval \
    --fp16 \
    --do_train \
    --learning_rate 3e-5 \
    --num_train_epochs $NEPOCH \
    --per_device_eval_batch_size 128 \
    --per_device_train_batch_size 16 \
    --max_seq_length 384 \
    --doc_stride 128 \
    --logging_steps 1 \
    --evaluation_strategy steps \
    --eval_steps 250 \
    --save_steps 500 \
    --overwrite_output_dir \
    --run_name $RUNID \
    --output_dir $OUTDIR \
    --nncf_compression_config $NNCFCFG

参考结果

Global Step: 39500
F1: 90.0873
EM: 83.264
Structured Sparsity (linear): 81.97%

vuiseng9/jpqd-bert-large-lt-30eph-r0.1600-s5e15

作者 vuiseng9

↓ 0 ♥ 0

创建时间: 2023-01-12 19:10:20+00:00

更新时间: 2023-01-12 19:17:38+00:00

在 Hugging Face 上查看

文件 (22)

.gitattributes
README.md
checkpoint-39500/config.json
checkpoint-39500/model.onnx ONNX
checkpoint-39500/openvino_config.json
checkpoint-39500/openvino_model.bin
checkpoint-39500/openvino_model.mapping
checkpoint-39500/openvino_model.xml
checkpoint-39500/optimizer.pt
checkpoint-39500/pytorch_model.bin
checkpoint-39500/rng_state_0.pth
checkpoint-39500/rng_state_1.pth
checkpoint-39500/rng_state_2.pth
checkpoint-39500/rng_state_3.pth
checkpoint-39500/scaler.pt
checkpoint-39500/scheduler.pt
checkpoint-39500/special_tokens_map.json
checkpoint-39500/tokenizer.json
checkpoint-39500/tokenizer_config.json
checkpoint-39500/trainer_state.json
checkpoint-39500/training_args.bin
checkpoint-39500/vocab.txt