Giter Club home page Giter Club logo

hugging_face_competition's Introduction

CCF BDCI BERT系统调优赛题baseline(Pytorch版本)

此版本基于Pytorch后端的huggingface进行实现。由于此实现使用了Oneflow的dataloader作为数据读入的方式,因此也需要安装Oneflow。其它框架的数据读取可以参考OneflowDataloaderToPytorchDataset类的实现。

使用说明

  1. 安装依赖(前置要求:已在环境中安装好PytorchOneflow

    pip install transformers pandas
    git clone https://github.com/tea321000/hugging_face_competition
    cd hugging_face_competition
  2. 运行train_BERT_base.sh和train_BERT_large.sh 单机单卡的baseline。保持其它参数不变,通过调节shell文件里的hidden_size参数,即可观察不同hidden_size所占显存的变化(可通过watch -n 0.1 nvidia-smi直观观察)

    python train.py \
    --ofrecord_path sample_seq_len_512_example \
    --lr 1e-4 --epochs 10 \
    --train_batch_size 2 \
    --seq_length=512 \
    --max_predictions_per_seq=80 \
    --num_hidden_layers=24 \
    --num_attention_heads=16 \
    --hidden_size=1024 \#要调节的参数
    --vocab_size=30522

hugging_face_competition's People

Contributors

tea321000 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.