提交 c780dd78 编写于 作者: Z Zeyu Chen

add simple demo

上级 35072117
export CUDA_VISIBLE_DEVICES=0
export CUDA_VISIBLE_DEVICES=3
# User can select chnsenticorp, nlpcc_dbqa, lcqmc for different task
DATASET="chnsenticorp"
......
......@@ -7,7 +7,8 @@ reader = hub.reader.ClassifyReader(hub.dataset.ChnSentiCorp(),
module.get_vocab_path())
task = hub.create_text_cls_task(feature=outputs["pooled_output"], num_classes=2)
strategy = hub.AdamWeightDecayStrategy(learning_rate=5e-5)
config = hub.RunConfig(use_cuda=True, num_epoch=3, strategy=strategy)
config = hub.RunConfig(
use_cuda=True, num_epoch=3, batch_size=32, strategy=strategy)
feed_list = [
inputs["input_ids"].name, inputs["position_ids"].name,
inputs["segment_ids"].name, inputs["input_mask"].name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册