t5_wikisql_SQL2en / README.md
dbernsohn's picture
Update README.md
7eb6316
|
raw
history blame
896 Bytes

t5_wikisql_SQL2en

This is t5_wikisql_SQL2en , a t5-small fine-tuned version on the wikisql dataset.

The model can be loaded like so:

from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("dbernsohn/t5_wikisql_SQL2en")
model = AutoModelWithLMHead.from_pretrained("dbernsohn/t5_wikisql_SQL2en")

You can then use this model to translate SQL queries into plain english.

query = "SELECT COUNT Params from model where location=HF-Hub"
input_text = f"translate English to SQL: {query} </s>"
features = tokenizer([input_text], return_tensors='pt')

output = model.generate(input_ids=features['input_ids'].cuda(), 
                        attention_mask=features['attention_mask'].cuda())

tokenizer.decode(output[0])

The whole training process and hyperparameters are in my [GitHub repo] (https://github.com/DorBernsohn)