You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andrew Charneski 90437c3d33 wip 3 days ago
src wip 5 months ago
.gitignore wip 6 months ago
LICENSE wip 1 month ago wip 5 months ago
pom.xml wip 2 months ago
tf-gpt-2.iml wip 3 days ago


Java library for the GPT-2 Text Model using Tensorflow


  1. Original Python Release
  2. OpenAI Blog - GPT2 Details

More Background:

  1. Transformers and Attention Models

Basic Usage

Import the Library


Instantiate the text generator

import com.simiacryptus.text.TextGenerator;
import com.simiacryptus.text.gpt2.GPT2Util;
TextGenerator textGenerator = GPT2Util.get345M();

Generate text


Generate text given prefix

System.out.println(textGenerator.generateText(500, "Once upon a time"));