GithubHelp home page GithubHelp logo

pasikon / bigbird Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thevasudevgupta/bigbird

0.0 0.0 0.0 9.51 MB

Google's BigBird @ 🤗Transformers

Home Page: https://huggingface.co/blog/big-bird

License: MIT License

Jupyter Notebook 96.00% Python 4.00%

bigbird's Introduction

BigBird

This repositary is tracking all my work related to porting Google's BigBird to 🤗Transformers. I also trained 🤗's BigBirdModel (with suitable heads) on some of datasets mentioned in the paper: Big Bird: Transformers for Longer Sequences. This repositary hosts those scripts as well!!

Updates @ 🤗

Description Dated Link
🤗's BigBird on TPUs May 13, 2021 PR #11651
Ported BigBird-Pegasus @ 🤗Transformers May 7, 2021 PR #10991
Published blog post @ 🤗Blog March 31, 2021 Link
Ported BigBird-RoBERTa @ 🤗Transformers March 30, 2021 PR #10183

Training BigBird

Training on natural-questions dataset

# switch to natural-questions specific directory
cd natural-questions

# install requirements
pip3 install -r requirements.txt

For preparing the dataset for training, run the following commands:

# this will download ~ 100 GB dataset from 🤗Hub & prepare training data in `data/nq-training.jsonl`
PROCESS_TRAIN=True python3 prepare_nq.py

# for preparing validation data in `data/nq-validation.jsonl`
PROCESS_TRAIN=False python3 prepare_nq.py

Above commands will download dataset from 🤗Hub & will prepare it for training. Remember this will download ~ 100 GB of dataset, so you need to have good internet connection & enough space (~ 250 GB free space). Preparing dataset will take ~ 3 hours.

Now, for distributed training on several GPUs, run the following command:

# For distributed training (using nq-training.jsonl & nq-validation.jsonl) on multiple gpus
python3 -m torch.distributed.launch --nproc_per_node=2 train_nq.py

You can follow this notebook for evaluating the fine-tuned model.

Checkpoint bigbird-roberta-natural-questions

To see how above checkpoint performs on QA task, checkout this:

Context is just a tweet taken from 🤗 Twitter Handle. 💥💥💥

bigbird's People

Contributors

patrickvonplaten avatar thevasudevgupta 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.