
A text2sql T5 model, finetuned from Flan-t5-base. Code: [Link](https://github.com/kevinng77/chat-table-t5/blob/master/prompt.py)
A further finetuning will significantly increase the performance of Flan-t5 model on Text-to-SQL tasks.


## Inference Example:


```python
from transformers import T5Tokenizer, T5ForConditionalGeneration, pipeline

table_columns = "Transaction_ID, Platform, Product_ID, User_ID, Transaction_Amount, Region, Transaction_Time, Transaction_Unit, User_Comments"

table_name = "my_data"

PROMPT_INPUT = f"""
Given a SQL table named '{table_name}' with the following columns:
{table_columns}

Construct a SQL query to answer the following question:
Q: {{question}}.
"""

model_id = "kevinng77/chat-table-flan-t5"
tokenizer = T5Tokenizer.from_pretrained(model_id)
model = T5ForConditionalGeneration.from_pretrained(model_id)

input_text = PROMPT_INPUT.format_map({"question": "How many rows are there in the table?"})

pipe = pipeline(
    "text2text-generation",
    model=model, tokenizer=tokenizer, max_length=512
)
```
{"language": ["en"], "license": "apache-2.0", "library_name": "transformers", "tags": ["text-generation-inference"], "pipeline_tag": "text2text-generation", "widget": [{"text": "Given a SQL table named 'price_data' with the following columns:\nTransaction_ID, Platform, Product_ID, User_ID, Transaction_Amount\nConstruct a SQL query to answer the following question:\nQ: How many rows are there\n", "example_title": "How many rows are there?"}]}
transformers pytorch t5 text2text-generation text-generation-inference en license:apache-2.0 autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #t5 #text2text-generation #text-generation-inference #en #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 


A text2sql T5 model, finetuned from Flan-t5-base. Code: Link
A further finetuning will significantly increase the performance of Flan-t5 model on Text-to-SQL tasks.


## Inference Example:



## Inference Example:
TAGS
#transformers #pytorch #t5 #text2text-generation #text-generation-inference #en #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
 ## Inference Example: