Downloads · 30 days
18
27% of all-time downloads
inference4j/gpt2
gpt2 is a text generation model from inference4j. Use it when you need the model to write or continue text. It is set up for onnx. The card lists the license as mit.
ONNX export of GPT-2 (124M parameters) with KV cache support for efficient autoregressive generation.
Downloads · 30 days
18
27% of all-time downloads
All-time downloads
67
Public
Repo size
653 MB
Likes
0
Public
Click a slice to open those files.
.onnx653 MB · 100%
From the Hugging Face model README
ONNX export of GPT-2 (124M parameters) with KV cache support for efficient autoregressive generation.
Converted for use with inference4j, an inference-only AI library for Java.
try (Gpt2TextGenerator gen = Gpt2TextGenerator.builder().build()) {
GenerationResult result = gen.generate("Once upon a time");
System.out.println(result.text());
}
| Property | Value |
|---|---|
| Architecture | GPT-2 (124M parameters, 12 layers, 768 hidden, 12 heads) |
| Task | Text generation |
| Context length | 1024 tokens |
| Vocabulary | 50257 tokens (BPE) |
| Original framework | PyTorch (transformers) |
| Export method | Hugging Face Optimum (with KV cache) |
This model is licensed under the MIT License. Original model by OpenAI.