Downloads · 30 days
17
28% of all-time downloads
poseidon1113/salesforce-codet5p-220m-sql-generator
salesforce-codet5p-220m-sql-generator is a machine learning model from poseidon1113. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Fine-tuned CodeT5+ 220M on the sql-create-context dataset to generate SQL queries from natural language questions and table schemas.
Downloads · 30 days
17
28% of all-time downloads
All-time downloads
60
Public
Parameters
297M
707 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors707 MB · 100%
How the weights are stored.
F16240M · 81%
From the Hugging Face model README
Fine-tuned CodeT5+ 220M on the sql-create-context dataset to generate SQL queries from natural language questions and table schemas.
from transformers import T5ForConditionalGeneration, AutoTokenizer
import torch
model = T5ForConditionalGeneration.from_pretrained("your-username/codet5p-sql-generator")
tokenizer = AutoTokenizer.from_pretrained("your-username/codet5p-sql-generator")
context = "CREATE TABLE employees (id INT, name VARCHAR, salary INT)"
question = "What is the average salary?"
src = f"Schema: {context}\nQuestion: {question}"
inputs = tokenizer(src, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128, num_beams=4)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))