# huggingface/pytorch-openai-transformer-lm

🐥A PyTorch implementation of OpenAI's finetuned transformer language model with a script to import the weights pre-trained by OpenAI

Repository: https://github.com/huggingface/pytorch-openai-transformer-lm
Canonical: https://ross.abutalabs.com/products/pytorch-openai-transformer-lm
Language: Python
License: MIT
License Family: permissive
Topics: neural-networks, pytorch, openai, language-model, transformer
Last push: 2021-08-09T16:17:12+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3003, "days_push": 1850, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1522, forks 285 (observed 2026-08-28T04:04:58.016810+00:00)

## What it is
A PyTorch reimplementation of OpenAI's finetuned transformer language model (GPT-1) from the paper 'Improving Language Understanding by Generative Pre-Training', including a script to import OpenAI's TensorFlow pre-trained weights. It also provides a modified Adam optimizer with fixed weight decay and scheduled learning rate for fine-tuning on classification tasks.

## Use cases
- load openai gpt-1 pretrained weights into pytorch
- run a transformer language model in pytorch
- fine-tune a pretrained transformer on text classification
- study the original gpt-1 model implementation
- convert tensorflow pretrained transformer weights to pytorch

## When to choose
- you need the exact original GPT-1 architecture in PyTorch for research or reproduction
- you want to import OpenAI's original TensorFlow pre-trained weights into PyTorch

## When to avoid
- you need modern pretrained models like GPT-2/3, BERT, or newer — use Hugging Face Transformers instead
- you want an actively maintained library with broad model support
- you need production-grade training tooling

## Facets
- artifact type: library
- maturity: abandoned
- function: machine-learning, llm-training, nlp
- domain: deep-learning, large-language-models
- platform: python
- tags: pytorch, transformer, gpt-1, pretrained-model, language-model, openai, historical, natural-language-processing

## Member repositories
- huggingface/pytorch-openai-transformer-lm (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:58.016810+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:31:47.257787+00:00, confidence not recorded.
  - readme: https://github.com/huggingface/pytorch-openai-transformer-lm (fetched 2026-08-28T04:04:58.016810+00:00, sha e4ceddf5dfee)
- Data as of 2026-08-30T08:39:29.467469+00:00.
