GPT-2 Small for OpenNN
OpenAI's GPT-2 Small converted by Artelnics to OpenNN's flat FP32 parameter
format, with a 256-token sequence length. Use it with OpenNN's
TextGenerationNetwork and the gpt2 example.
| File | Contents |
|---|---|
gpt2-small-seq256.bin |
OpenNN parameter buffer, 649996672 bytes |
vocab.json |
Original 50,257-token mapping, serialized for the tokenizer |
merges.txt |
Original byte-pair merges |
LICENSE_GPT2.txt |
Complete original OpenAI Modified MIT License |
SOURCE.md |
Original source, conversion, attribution and SHA-256 digests |
Usage
Build OpenNN target gpt2 with CUDA and run it from the executable directory:
./gpt2 "Artificial intelligence"
The example downloads the files into ../data/gpt2, generates at most 40 new
tokens and labels the continuation as GPT-2 generated text. Its model dimensions
are 256, 50258, 768, 12, 3072, 12; OpenNN reserves [PAD] at index zero.
Original source and licence
Software Copyright (c) 2019 OpenAI. The model retains the original Modified MIT License, including its additional generated-content paragraphs. Preserve LICENSE_GPT2.txt and SOURCE.md with redistributed weights and tokenizer files. OpenNN's software licence does not replace the model licence.
Credit: Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei and Ilya Sutskever, Language Models are Unsupervised Multitask Learners, 2019. See OpenAI's original release and the original model card for training details and limitations. The converted model uses a shorter 256-token context; generated text is not a verified factual source.
File identity
These are the unchanged assets formerly distributed as gpt2-weights-v1.
Their sizes and SHA-256 digests are recorded in SOURCE.md. The OpenNN binary
uses its compiled parameter layout; match the example's dimensions when loading.
Model tree for Artelnics/gpt2-small-opennn
Base model
openai-community/gpt2