From 752745e405675d4cba1a30bc910e99e40773185a Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Mon, 13 Apr 2020 22:00:24 +0800 Subject: [PATCH] Add demo for training bert teacher on upstream task. --- demo/bert/train_teacher.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 demo/bert/train_teacher.py diff --git a/demo/bert/train_teacher.py b/demo/bert/train_teacher.py new file mode 100644 index 00000000..73d4a83f --- /dev/null +++ b/demo/bert/train_teacher.py @@ -0,0 +1,9 @@ +import paddle.fluid as fluid +from paddleslim.teachers.bert import BERTClassifier + +place = fluid.CUDAPlace(fluid.dygraph.parallel.Env().dev_id) + +with fluid.dygraph.guard(place): + + bert = BERTClassifier(3) + bert.fit("./data/glue_data/MNLI/", 1, batch_size=32) -- GitLab