| --- |
| library_name: onnx |
| tags: |
| - text2text-generation |
| - t5 |
| - flan-t5 |
| - encoder-decoder |
| - onnx |
| - inference4j |
| license: apache-2.0 |
| pipeline_tag: text2text-generation |
| --- |
| |
| # Flan-T5 Base — ONNX |
|
|
| ONNX export of [Flan-T5 Base](https://huggingface.co/google/flan-t5-base) (250M parameters) with encoder-decoder architecture and KV cache support. |
|
|
| Converted for use with [inference4j](https://github.com/inference4j/inference4j), an inference-only AI library for Java. |
|
|
| ## Original Source |
|
|
| - **Repository:** [google/flan-t5-base](https://huggingface.co/google/flan-t5-base) |
| - **License:** Apache 2.0 |
|
|
| ## Usage with inference4j |
|
|
| ```java |
| // Summarization |
| try (var gen = FlanT5TextGenerator.flanT5Base().build()) { |
| System.out.println(gen.summarize("Long article text...")); |
| } |
| |
| // Translation |
| try (var gen = FlanT5TextGenerator.flanT5Base().build()) { |
| System.out.println(gen.translate("Hello!", Language.EN, Language.FR)); |
| } |
| ``` |
|
|
| ## Model Details |
|
|
| | Property | Value | |
| |----------|-------| |
| | Architecture | T5 encoder-decoder (250M parameters) | |
| | Tasks | Summarization, translation, grammar correction, text-to-SQL | |
| | Tokenizer | SentencePiece (32,128 tokens) | |
| | Original framework | PyTorch (transformers) | |
| | Export method | Hugging Face Optimum (encoder-decoder with KV cache) | |
|
|
| ## License |
|
|
| This model is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). Original model by [Google](https://huggingface.co/google). |
|
|