Code Monkey home page Code Monkey logo

gpt2-cpp-ov's Introduction

GPT2

This is a simple repo with an implementation of the GPT2 tokenizer + execution of the GPT2 ONNX model provided here.

Installation

The cmake script will look for onnxruntime header files and dynamic library using the repo structure based from the $HOME directory. After compiling make sure that the dynamic library can be found by the runtime, ie. set LD_LIBRARY_PATH accordingly.

The other three dependencies are already included in this project:

Compiling the binary requires a C++17 compliant compiler. Additionally the ONNX model is downloaded during the build process from the ONNX Model Zoo repo. The model is 634 MB large, so it may take a while to download it :)

The vocabulary and merges files are provided in this repository, but were originally obtained from the transformers repo.

mkdir build && cd build
cmake ..
make

Usage

cd build
./gpt2-generate -t "I've got a q" -n 5
Prediction: "I've got a qwerty knife!!"

gpt2-cpp-ov's People

Contributors

gf712 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.