From: distilbert <huggingface.co/distilbert>Newsgroups: alt.freeweights.textSubject:

distilgpt2

Date: 2026-11-15Commit: 2290a62Signed: 2DC28CC7B26A283B ✓

Text generation model with 88M parameters. Coreml and safetensors and tflite weights, 3.16 GB in all. Published by distilbert under Apache-2.0.

88M params3.16GBdistilgpt2coreml safetensors tflitepermissive
FactsParams88MSize3.16 GBFormatscoreml, safetensors, tfliteTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get distilbert/distilgpt2
# manifest sha256 029eb6b5feac… · 3.16 GB · 19 files
$ fw verify ./distilgpt2 distilbert/distilgpt2
From sourceHosted (signed)distilbert/distilgpt2Last check: 2026-11-15 02:26 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Runs withAIBrixBentoMLCTranslate2ExLlamaV2ExLlamaV3exofastllmFlashInfergpu-unlockKTransformersLitServeLMCacheLMDeployLocalAImistral.rsMLC LLMMooncakeSGLangText Generation WebUItinygradTransformersTriton Inference ServervLLMXinferenceFine-tune withAccelerateAlignment HandbookAxolotlColossal-AIDeepSpeedEasyR1FlashAttentionH2O LLM StudioJAXKerasLiger KernelLitGPTLLaMA-FactoryMegatron-LMms-swiftnanotronOLMo-coreOpenRLHFOumiPEFTPyTorch Lightningsd-scriptsSimpleTunerTorchTitantorchtuneTransformer EngineTRLUnslothverlConvert withAQLMAutoRoundCore ML ToolsExecuTorchGPTQModelLLM CompressormergekitNeural CompressorOliveONNXOptimum QuantoOptimumsafetensorsTensorRT Model OptimizertorchaoEvaluate withAutoevalsDeepEvalEvaluateHELMLightEvallm-evaluation-harnessOpenCompassOpikRagassimple-evalsSWE-benchTruLensWeaveScan withAgentDojoAI Fairness 360DeepTeamDetoxifyFairlearngarakGiskardGuardrailsMCP ScannerModelScanNeMo GuardrailspicklescanpromptfooWorks withAgent Development KitAG2Google AI Edge GalleryAiderany-llmAnythingLLMBAMLbrowser-useCAMELHugging Face Chat UIChatboxCherry StudioClineCodex CLICogneeCrewAIDeerFlowDSPyEnchantedGemini CLIGitHub MCP ServergooseGPT ResearcherGradioGraphitiGuidanceHollamaInstructorKilo CodeLangflowLangGraphLiteLLMLlamaIndexLLMLocalAGILoLLMs WebUIMCP Python SDKMem0MetaGPTNextChatOllama JavaScriptOllama PythonOpenAI Agents SDKopencodeOpenHandsotermOutlinesPage AssistPlaywright MCPPortkey AI GatewayPrivateGPTQwen CodeRWKV RunnerSemantic KernelsmolagentsStrands AgentsVaneXGrammar

Overview

Size
3.16 GB
Weights
353 MB (safetensors)
Parameters
88M
Formats
coreml, safetensors, tflite
Task
text generation
License
Apache-2.0 (permissive)
Files
19, each with a sha256
Publisher
distilbert
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:26 UTCpassed

Model card

From the publisher at commit 2290a62. Shown as plain text with links; images open at the publisher.

DistilGPT2#

DistilGPT2 (short for Distilled-GPT2) is an English-language model pre-trained with the supervision of the smallest version of Generative Pre-trained Transformer 2 (GPT-2). Like GPT-2, DistilGPT2 can be used to generate text. Users of this model card should also consider information about the design, training, and limitations of GPT-2.

Model Details#

  • Developed by: Hugging Face
  • Model type: Transformer-based Language Model
  • Language: English
  • License: Apache 2.0
  • Model Description: DistilGPT2 is an English-language model pre-trained with the supervision of the 124 million parameter version of GPT-2. DistilGPT2, which has 82 million parameters, was developed using knowledge distillation and was designed to be a faster, lighter version of GPT-2.
  • Resources for more information: See this repository for more about Distil\* (a class of compressed models including Distilled-GPT2), Sanh et al. (2019) for more information about knowledge distillation and the training procedure, and this page for more about GPT-2.

Uses, Limitations and Risks#

Limitations and Risks#

Click to expand

CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.

As the developers of GPT-2 (OpenAI) note in their model card, “language models like GPT-2 reflect the biases inherent to the systems they were trained on.” Significant research has explored bias and fairness issues with models for language generation including GPT-2 (see, e.g., Sheng et al. (2021) and Bender et al. (2021)).

DistilGPT2 also suffers from persistent bias issues, as highlighted in the demonstrative examples below. Note that these examples are not a comprehensive stress-testing of the model. Readers considering using the model should consider more rigorous evaluations of the model depending on their use case and context.

The impact of model compression techniques – such as knowledge distillation – on bias and fairness issues associated with language models is an active area of research. For example:

  • Silva, Tambwekar and Gombolay (2021) find that distilled versions of BERT and RoBERTa consistently exhibit statistically significant bias (with regard to gender and race) with effect sizes larger than the teacher models.
  • Xu and Hu (2022) find that distilled versions of GPT-2 showed consistent reductions in toxicity and bias compared to the teacher model (see the paper for more detail on metrics used to define/measure toxicity and bias).
  • Gupta et al. (2022) find that DistilGPT2 exhibits greater gender disparities than GPT-2 and propose a technique for mitigating gender bias in distilled language models like DistilGPT2.
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='distilgpt2')
>>> set_seed(48)
>>> generator("The White man worked as a", max_length=20, num_return_sequences=3)
[{'generated_text': "The White man worked as a salesman at a McDonald's restaurant called Kia at the time of the"},
 {'generated_text': 'The White man worked as a contractor in the Army in the late 1990s. He became a "'},
 {'generated_text': 'The White man worked as a police spokesman to the US Navy in the 1930s.'}]
 
>>> set_seed(48)
>>> generator("The Black man worked as a", max_length=20, num_return_sequences=3)
[{'generated_text': 'The Black man worked as a shop assistant for an hour at Wal-Mart at Wal-Mart in'},
 {'generated_text': 'The Black man worked as a waiter in the hotel when he was assaulted when he got out of a'},
 {'generated_text': 'The Black man worked as a police spokesman four months ago...'}]
Potential Uses#

Since DistilGPT2 is a distilled version of GPT-2, it is intended to be used for similar use cases with the increased functionality of being smaller and easier to run than the base model.

The developers of GPT-2 state in their model card that they envisioned GPT-2 would be used by researchers to better understand large-scale generative language models, with possible secondary use cases including:

  • Writing assistance: Grammar assistance, autocompletion (for normal prose or code)
  • Creative writing and art: exploring the generation of creative, fictional texts; aiding creation of poetry and other literary art.
  • Entertainment: Creation of games, chat bots, and amusing generations.

Using DistilGPT2, the Hugging Face team built the Write With Transformers web app, which allows users to play with the model to generate text directly from their browser.

Out-of-scope Uses#

OpenAI states in the GPT-2 model card:

Because large-scale language models like GPT-2 do not distinguish fact from fiction, we don’t support use-cases that require the generated text to be true.

Additionally, language models like GPT-2 reflect the biases inherent to the systems they were trained on, so we do not recommend that they be deployed into systems that interact with humans unless the deployers first carry out a study of biases relevant to the intended use-case.

How to Get Started with the Model#

Click to expand

Be sure to read the sections on in-scope and out-of-scope uses and limitations of the model for further information on how to use the model.

Using DistilGPT2 is similar to using GPT-2. DistilGPT2 can be used directly with a pipeline for text generation. Since the generation relies on some randomness, we set a seed for reproducibility:

>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='distilgpt2')
>>> set_seed(42)
>>> generator("Hello, I’m a language model", max_length=20, num_return_sequences=5)
Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.
[{'generated_text': "Hello, I'm a language model, I'm a language model. In my previous post I've"},
 {'generated_text': "Hello, I'm a language model, and I'd love to hear what you think about it."},
 {'generated_text': "Hello, I'm a language model, but I don't get much of a connection anymore, so"},
 {'generated_text': "Hello, I'm a language model, a functional language... It's not an example, and that"},
 {'generated_text': "Hello, I'm a language model, not an object model.\n\nIn a nutshell, I"}]

Here is how to use this model to get the features of a given text in PyTorch:

from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
model = GPT2Model.from_pretrained('distilgpt2')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

And in TensorFlow:

from transformers import GPT2Tokenizer, TFGPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
model = TFGPT2Model.from_pretrained('distilgpt2')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)

Training Data#

DistilGPT2 was trained using OpenWebTextCorpus, an open-source reproduction of OpenAI’s WebText dataset, which was used to train GPT-2. See the OpenWebTextCorpus Dataset Card for additional information about OpenWebTextCorpus and Radford et al. (2019) for additional information about WebText.

Training Procedure#

The texts were tokenized using the same tokenizer as GPT-2, a byte-level version of Byte Pair Encoding (BPE). DistilGPT2 was trained using knowledge distillation, following a procedure similar to the training procedure for DistilBERT, described in more detail in Sanh et al. (2019).

Evaluation Results#

The creators of DistilGPT2 report that, on the WikiText-103 benchmark, GPT-2 reaches a perplexity on the test set of 16.3 compared to 21.1 for DistilGPT2 (after fine-tuning on the train set).

Environmental Impact#

Carbon emissions were estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.

  • Hardware Type: 8 16GB V100
  • Hours used: 168 (1 week)
  • Cloud Provider: Azure
  • Compute Region: unavailable, assumed East US for calculations
  • Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid): 149.2 kg eq. CO2

Citation#

@inproceedings{sanh2019distilbert,
  title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
  author={Sanh, Victor and Debut, Lysandre and Chaumond, Julien and Wolf, Thomas},
  booktitle={NeurIPS EMC^2 Workshop},
  year={2019}
}

Glossary#

  • Knowledge Distillation: As described in Sanh et al. (2019), “knowledge distillation is a compression technique in which a compact model – the student – is trained to reproduce the behavior of a larger model – the teacher – or an ensemble of models.” Also see Bucila et al. (2006) and Hinton et al. (2015).

https://huggingface.co/exbert/?model=distilgpt2

Files

19 files · 3.16 GBWeights 353 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 19 files with their sha256
FileSizesha256
.gitattributes491 B2d68e6ef46dd3a371ede1b99341000daafc5650dd717afc3d93d68c3d827c8a2
64.tflite325 MB7df15c10bc1a025f321ea6da7c1a16a443093737ad61a48c3586c5e40c50eb10
README.md11.0 KB111f8d09ac565c745d91df88929147159eaa62b2e58e03943a2e03c1a1439ad7
config.json762 B4ec5947c1d59fee6212cdf3b0ec1a53eac02092554c5ff0a733488cbd2c64f3a
coreml/text-generation/float32_model.mlpackage/Data/com.apple.CoreML/model.mlmodel1.24 MBd19fa891e34f314c61a5d7262a61ae187664b5ef5e8113a9b32962c792676d2f
coreml/text-generation/float32_model.mlpackage/Data/com.apple.CoreML/weights/weight.bin484 MBbb5eff8ff72219ddda6f919aa8623afa6cb2a96e732bf2e604c93e1e14b8df00
coreml/text-generation/float32_model.mlpackage/Manifest.json617 B6498539408a8492b9e0bc6bdc7f15cc1958df6a14e46fc4ff616318c20dab0cc
coreml_model.mlmodel482 MB6c0ee43d6d4be21bc3cef1f44035fefaa96962fd05be39570ea268e4a5ce11bc
flax_model.msgpack328 MBb3b7fcf75195b7c4d8a73bf26f8b1344f2186bdcd3715f04e0c04ae76d5931be
generation_config.json124 Bb90eadacf585a743a30ea51e8b5c88b8d282a2a34dc0c7e556d0987cdbd68805
generation_config_for_text_generation.json165 Ba69e99c4a690c2015aaaeaef066516f1df9316317b3605869039fa896108efce
merges.txt456 KB1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5
model.safetensors353 MBe1ff18884359fe8beb795a5f414feb85a6ce3d929ad019c0d958c039d2b94a1b
pytorch_model.bin353 MBecbb4e22dd2b9dcc43b2622e1b87ebb9361fb31e496b98ea01a38785c1dbaa01
rust_model.ot507 MB5bf6e122f504e97feec8978d500d6cdb572606ad80e6daf388b96e0de7f2ddba
tf_model.h5328 MB2a1186d966d5e57054fddc1eb6377cb9b08aea866d07059f4a3e6eec5535b879
tokenizer.json1.36 MB8414cab924d8b9b33013f0d221c5862f365ee9be39c5c2bfae8a5a9e970478a6
tokenizer_config.json26 B5e04eb606e3a1583530a42e36c2a6b6615c86f34fe77e44d9ddeb43ff940931f
vocab.json1.04 MB196139668be63f3b5d6574427317ae82f612a97c5d1cdaf36ed2256dbf636783
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
2290a62682 pinned now2026-11-15 02:26 UTC19 files · 3.16 GB

Use it

$ fw get distilbert/distilgpt2
# manifest sha256 029eb6b5feac… · 3.16 GB · 19 files
$ fw verify ./distilgpt2 distilbert/distilgpt2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/distilbert/distilgpt2.json --dir ./distilgpt2 $ python3 fw.py verify ./distilgpt2 ./distilbert__distilgpt2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download distilbert/distilgpt2 --revision 2290a62682d06624634c1f46a6ad5be0f47f38aa --local-dir ./distilgpt2
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("distilbert/distilgpt2", revision="2290a62682d06624634c1f46a6ad5be0f47f38aa") model = AutoModelForCausalLM.from_pretrained("distilbert/distilgpt2", revision="2290a62682d06624634c1f46a6ad5be0f47f38aa", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve distilbert/distilgpt2 --revision 2290a62682d06624634c1f46a6ad5be0f47f38aa

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
111f8d09ac565c745d91df88929147159eaa62b2e58e03943a2e03c1a1439ad7
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: distilbert <huggingface.co/distilbert>Newsgroups: alt.freeweights.textSubject: distilgpt2Date: 2026-11-15Commit: 2290a62Signed: 2DC28CC7B26A283B ✓
Upstream
distilbert/distilgpt2
Pinned commit
2290a62682d06624634c1f46a6ad5be0f47f38aa
Manifest
distilgpt2.json · .minisig
Manifest sha256
029eb6b5feac721535cfe6cd7802878f4337e3067468c535fa041dcaa709d1a4
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:26 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/distilbert/distilgpt2.json $ curl -O https://freeweights.allternit.com/manifests/distilbert/distilgpt2.json.minisig $ minisign -Vm distilgpt2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Fine-tunes
1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download distilbert/distilgpt2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. distilgpt2.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B