GithubHelp home page GithubHelp logo

jackliaoall-ai-nlp / swift-coreml-transformers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huggingface/swift-coreml-transformers

0.0 1.0 0.0 9.44 MB

Swift Core ML 3 implementations of GPT-2, DistilGPT-2, BERT, and DistilBERT for Question answering. Other Transformers coming soon!

License: Apache License 2.0

Swift 80.63% Python 19.37%

swift-coreml-transformers's Introduction

Swift Core ML implementations of Transformers: GPT-2, DistilGPT-2, BERT, DistilBERT, more coming soon!

This repository contains:

  • For BERT and DistilBERT:
    • pretrained Google BERT and Hugging Face DistilBERT models fine-tuned for Question answering on the SQuAD dataset.
    • Swift implementations of the BERT tokenizer (BasicTokenizer and WordpieceTokenizer) and SQuAD dataset parsing utilities.
    • A neat demo question answering app.
  • For GPT-2 and DistilGPT-2:
    • a conversion script from PyTorch trained GPT-2 models (see our transformers repo) to CoreML models.
    • The GPT-2 generation model itself, including decoding strategies (greedy and TopK are currently implemented) and GPT-2 Byte-pair encoder and decoder.
    • A neat demo app showcasing on-device text generation.

๐Ÿฆ„ GPT-2 and DistilGPT-2

Unleash the full power of text generation with GPT-2 on device!!

demo

๐Ÿธ BERT and DistilBERT

The BERTSQUADFP16 Core ML model was packaged by Apple and is linked from the main ML models page. It was demoed at WWDC 2019 as part of the Core ML 3 launch.

The DistilBERT Core ML models were converted from ๐Ÿค—/transformers exports using the scripts in this repo.

core ml 3

๐Ÿฆ„ Demo Time ๐Ÿ”ฅ

demo

Apple demo at WWDC 2019

wwdc demo

full video here

BERT Architecture (wwdc slide)

bert

Notes

We use git-lfs to store large model files and it is required to obtain some of the files the app needs to run. See how to install git-lfson the installation page

swift-coreml-transformers's People

Contributors

julien-c avatar lysandrejik avatar bilal2vec avatar hollance 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.