#113 · Primary category: Foundation Models
gpt-2-Pytorch
Simple Text-Generator with OpenAI gpt-2 Pytorch Implementation
Project last updated:07/08/19
GitHub Stars
1.0K
Forks
230
Contributors
2
License
MIT
Why we included this project
This compact PyTorch rewrite of GPT-2 keeps the model small enough to read end to end. Where OpenAI's reference implementation carries a lot of infrastructure, this one pares it down to the self-attention stack and the text-generation loop, so you can watch a token move from input through the layers to the sampled next word. That makes it a good study tool for researchers or students who already know PyTorch and want to see how a transformer actually produces text, rather than a service you'd deploy in production. It also shows how to load the pretrained GPT-2 weights into PyTorch, which helps if you want to experiment outside the TensorFlow ecosystem. Pair it with the GPT-2 paper and the larger Hugging Face codebase for context.
Articles for this project
No articles for this project yet.
To suggest a topic or contribute an article, contact us.
Related projects in this category
transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
CLIP
CLIP (Contrastive Language-Image Pretraining), Predict the most relevant text snippet given an image
MiniCPM-V
A Pocket-Sized MLLM for Ultra-Efficient Image and Video Understanding on Your Phone
generative-models
Generative Models by Stability AI
unilm
Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities