HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
minimaxir
gpt-2-simple
Python2019–2025
minimaxir / gpt-2-simple

gpt-2-simple

Python package to easily retrain OpenAI's GPT-2 text-generating model on new texts

10Distinct people
19Mentions
0Explicit recommenders
3.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Python package to easily retrain OpenAI's GPT-2 text-generating model on new texts

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 4:59:52 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year19 dated mentions

Observed mentions: 2019-04-19 16:11:20 UTC to 2025-12-14 05:48:43 UTC.

02468102019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC1019
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC606
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

6 sources
The GPT-2 weights were released by OpenAI when GPT-2 was released. (https://github.com/openai/gpt-2) Around that time (since no one else was doing it) I released a wrapper to streamline that code and make it much easier to finetune on your own data. (https://github.com/minimaxir/gpt-2-simple) Nowadays, the easiest way to interact with GPT-2 is to use the transformers library (https://github.com/huggingface/transformers), of which I've created a much better library for GPT-2 that leverages it. (https://github.com/minimaxir/aitextgen)
In Does GPT-2 Know Your Phone Number?
If you want to play with your own GPT-2 API, I put this together and shared it on HN yesterday: https://github.com/cortexlabs/cortex/tree/master/examples/py... You can run that and deploy your own GPT-2 API locally, or in the cloud. I'd also recommend checking out Max Woolf's gpt-2-simple, which is a library that makes it really easy to fine tune GPT-2 with your own text (if you've played the free version of AI Dungeon, this is how they trained their model): https://github.com/minimaxir/gpt-2-simple
In Low-code, no-model recommendation system with GPT3
With GPT-3 getting so many people interested in NLP, and with OpenAI's recently announced pricing plan putting it out of many people's reach, I thought it might be useful for some to see how easy it is to deploy your own GPT-2 API. This project uses a couple tools: - Cortex: An open source model serving platform I help maintain. https://github.com/cortexlabs/cortex - Hugging Face's Transformers: An open source library for using popular language models, like GPT-2. https://github.com/huggingface/transformers This project uses a vanilla pre-trained GPT-2 and PyTorch. If you want to use TensorFlow/ONNX, that's supported as well ( https://github.com/cortexlabs/cortex/tree/master/examples/te... ). If you want to finetune GPT-2 on your own text (a la AI Dungeon), I'd suggest using gpt-2-simple and deploying with Cortex: https://github.com/minim
Read the rest
axir/gpt-2-simple Lastly, by following this example, you can deploy your API locally (where inference will probably be slow, depending on your hardware, but will cost you $0) or to a cluster on AWS, which Cortex can spin up/manage for you.
In Show HN: Can't afford GPT-3 access? Self-host your own GPT-2 API
She said it was amazingly beautiful and would have been really moved by it had it not been written by an AI. I counter-argued that human curation of AI generated text was a perfectly valid expression of love. I lost :-|. The model generates results that are formatted like love letters with reasonably structured phrases. Verbatim reproduction of training content seems very low. But the sentences are often nonsensical and there's not much context preservation apart from some repetition. However it does generate some quite interesting original phrases: " Mon âme a moins de conversations que le désir " " C'est une joie bien trop violente pour moi " " vous [êtes] comme l'eau d'un pur amour " These phrases can be cherry-picked based on the feeling you're trying to convey and used to compose unique letters influenced by the best french writers i
Read the rest
n history. Technically: an OpenAI GPT-2 model (117/124M parameters) trained on around 1Gb of french classical litterature was fine-tuned on 300Kb of french love poetry and love songs. We used GPT-2-Simple https://github.com/minimaxir/gpt-2-simple and GPT-2-Cloud-Run https://github.com/minimaxir/gpt-2-cloud-run by Max Woolf. The base french model (GPT2-French) was trained by William Jacques: https://github.com/aquadzn/gpt2-french. We used his "romans" model which is trained using text from https://www.bibebook.com/download, which looks like a compilation of project Gutenberg french novels. His model is trained over 5000 steps. Fine-tuning was done using Max Woolf's Colab notebook: https://colab.research.google.com/drive/1VLG8e7YSEwypxU-noRN... and lasted only 600 steps (less than 30 minutes). Less steps and the content wasn't great, more and it started to reproduce training content verbatim.
In Show HN: I used AI to write my wife a Valentine's day love letter (in French)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.