Downloads · 30 days
17
21% of all-time downloads
inference4j/t5-small-awesome-text-to-sql
t5-small-awesome-text-to-sql 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 apache-2.0.
ONNX export of t5-small-awesome-text-to-sql (60M parameters) with encoder-decoder architecture and KV cache support.
Downloads · 30 days
17
21% of all-time downloads
All-time downloads
80
Public
Repo size
462 MB
Likes
0
Public
Click a slice to open those files.
.onnx462 MB · 99%
From the Hugging Face model README
ONNX export of t5-small-awesome-text-to-sql (60M parameters) with encoder-decoder architecture and KV cache support.
A lightweight T5-small model fine-tuned for text-to-SQL generation. Accepts database schemas as CREATE TABLE DDL statements and generates SQL queries from natural language questions.
Converted for use with inference4j, an inference-only AI library for Java.
try (var sqlGen = T5SqlGenerator.t5SmallAwesome().build()) {
String sql = sqlGen.generateSql(
"How many employees are in each department?",
"CREATE TABLE employees (id INT, name VARCHAR, department VARCHAR, salary INT); "
+ "CREATE TABLE departments (id INT, name VARCHAR)");
System.out.println(sql);
}
The model expects standard SQL DDL as schema input:
CREATE TABLE employees (id INT, name VARCHAR, salary INT); CREATE TABLE departments (id INT, name VARCHAR)
For higher accuracy on complex multi-table queries with JOINs, GROUP BY, and subqueries, consider the larger
T5-LM-Large-text2sql-spider (0.8B parameters).
| Property | Value |
|---|---|
| Architecture | T5 encoder-decoder (60M parameters) |
| Task | Text-to-SQL generation |
| Training data | b-mc2/sql-create-context, Clinton/Text-to-sql-v1 (340k samples) |
| Tokenizer | SentencePiece (32,128 tokens) |
| Original framework | PyTorch (transformers) |
| Export method | Hugging Face Optimum (encoder-decoder with KV cache) |
This model is licensed under the Apache License 2.0. Original model by cssupport.