Giter VIP home page Giter VIP logo

transformers_tutorial's Introduction

Transformer-based model tutorial

transformers库为我们提供了很好的NLP模型调用范例。然而,随着模型量的增多,其代码越来越复杂和抽象,不利于初学者学习和理解。

本项目旨在脱离transformers库,完全用PyTorch底层实现各个模型的代码,并力求适配transformers库的类、方法和超参。计划中的模型包括:

  • Transformer类,如BART、T5等
  • BERT类,如BERT、RoBerta、DeBerta等
  • GPT类,如GPT2等

将模型结构原原本本展现在您面前,便于您的学习和魔改。

Quick Start

  1. 下载本仓库并配置必要环境
git clone https://github.com/JinHanLei/Transformers_tutorial && cd Transformers_tutorial
pip install -r requirements.txt
  1. 进入模型各自的文件夹,运行main.py

本仓库正在快速更新中,请关注我或者star本项目,及时获取更新状态!

Dependencies

  • python==3.9
  • PyTorch==2.0.0
  • transformers==4.31.0
  • gradio
  • sentencepiece
  • protobuf
  • cpm-kernels

Author

transformers_tutorial's People

Contributors

jinhanlei avatar

Stargazers

White_He avatar Kerry Niker avatar Yan avatar 倾心画念 avatar

Watchers

 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.