Downloads · 30 days
104
5% of all-time downloads
Ellbendls/Qwen-3-4b-Text_to_SQL
Qwen-3-4b-Text_to_SQL is a text generation model from Ellbendls. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of Qwen/Qwen3-4B designed to convert natural language queries into SQL statements. It was trained on the gretelai/synthetictexttosql dataset and can provide both SQL queries and tabl…
Downloads · 30 days
104
5% of all-time downloads
All-time downloads
1.9K
Public
Parameters
4B
11.3 GB on disk
Likes
7
Public
Click a slice to open those files.
.safetensors11.3 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of Qwen/Qwen3-4B designed to convert natural language queries into SQL statements. It was trained on the gretelai/synthetic_text_to_sql dataset and can provide both SQL queries and table schema context when needed.
This model has been fine-tuned to help users generate SQL queries based on natural language prompts. In scenarios where table schema context is missing, the model is trained to generate schema definitions along with the SQL query. The base Qwen-3-4B provides stronger multilingual support and larger context windows.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Ellbendls/Qwen-3-4B-Text_to_SQL")
model = AutoModelForCausalLM.from_pretrained("Ellbendls/Qwen-3-4B-Text_to_SQL")
# Input prompt
query = "What is the average salary by department in 2024?"
# Tokenize input and generate output
inputs = tokenizer(query, return_tensors="pt")
outputs = model.generate(**inputs, max_length=512)
# Decode and print
print(tokenizer.decode(outputs[0], skip_special_tokens=True))