Code Monkey home page Code Monkey logo

huggingface_nlp_task_finetuning's Introduction

HuggingFace NLP Tasks FineTuning Notebooks

This repository contains notebooks which show how to finetune language models using the HuggingFace Libraries. There are 6 main NLP tasks which have their own notebook:

  1. Causal Language Modelling: Given a sequence of text, predict the next tokens in the sequence.
  2. Masked Language Modelling: Given a sequence of text, mask out particular tokens and predict those masked tokens.
  3. Translation: Translate a sequence of text from a source language to a target language.
  4. Summarisation: Given a sequence of text, produce a shortened sequence that summarises the longer sequences.
  5. Token Classification: Named entity recognition within a sequence.
  6. Question Answering: Given a sequence of text which is an instruction/ question and some context provided, generate a sequence of text that answers that question using the context.

These notebooks all require GPUs for training, hence it is advised to run them with Google Colab.

There are 3 subdirectories in this repository:

  1. trainer: Finetunes model using the HuggingFace Trainer API - represents the most straightforward way of model finetuning.
  2. PyTorch: Trainer API is largely build on top of PyTorch. These notebooks show how to finetune models using a PyTorch training loop without relying on the Trainer API.
  3. PEFT: Finetuning models using the HuggingFace Trainer API and using the PEFT library to introduce and finetune LoRA (Low Rank Adaptation) Adapters.

Note: These Notebooks mirror the official HuggingFace Transformers Docs with additional code for clarification. It is more than possible that there is some erroneous or superfluous code in the Notebooks. If seen, please make a Github issue with this repo and I will correct them.

References

  1. HuggingFace Transformers Main NLP Tasks
  2. Parameter Efficient Fine Tuning
  3. Transformers and Large Language Models Study List
  4. Create a Training Loop for PyTorch Models

huggingface_nlp_task_finetuning's People

Contributors

junaidmb avatar

Watchers

 avatar

Forkers

rbehjati

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.