Run this model with HF Jobs

Run juierror/flan-t5-text2sql-with-schema-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/juierror/flan-t5-text2sql-with-schema-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/juierror/flan-t5-text2sql-with-schema-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/juierror/flan-t5-text2sql-with-schema-v2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/juierror/flan-t5-text2sql-with-schema-v2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

The results are a little off.

#2
by moon-cake22 - opened

I tried it with this input "convert question and table into SQL query. tables: student_name(id,name), student_age(student_id,age). question: how many students with name jui and age less than 25"

I get "SELECT count(*) FROM student_name WHERE name = 'jui' AND age < 25". I just renamed the input parameters, didn't change the overall structure of the tables.

@moon-cake22 Thank you very much for the testing.

I notice this point as well. The current result is not good for some type of table. I will try to improve it further.

@juierror . Could you please provide scripts for how you're finetuning this model? Thanks!

Thank you!

Thanks for letting us play around with the model. Here is another prompt that came out wrong, if you want more training material:

print(inference(
"Among the artists having concerts in year 2020, which artist has a song whose title equals the name of the stadium on which the concert takes place?",
{
"stadium": ["stadium_id", "location", "name", "capacity", "highest", "lowest", "average"],
"singer": ["singer_id", "name", "country", "song_name"],
"concert": ["concert_id", "stadium_id", "year"],
"singer_in_concert": ["concert_id", "singer_id"]
}))

Returned (which would not work):

SELECT T1.song_name
FROM singer AS T1
JOIN concert AS T2 ON T1.singer_id = T2.singer_id
WHERE T2.year = 2020
AND T1.stadium_id = (
SELECT stadium_id FROM concert WHERE YEAR = 2020
)

@tordbb Thank you very much.

@juierror Have you retrained the model to reduce the error queries as mentioned by other users? Where can I find the new model?

@Kushrjain

To be frank, I still did not have a time to retrain the model. The current model is still not updated.

Sign up or log in to comment