Downloads · 30 days
22
1% of all-time downloads
Omaratef3221/Qwen2-0.5B-Instruct-SQL-query-generator
Qwen2-0.5B-Instruct-SQL-query-generator is a text generation model from Omaratef3221. 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/Qwen2-0.5B-Instruct on the motherduckdb/duckdb-text2sql-25k dataset (first 10k rows).
Downloads · 30 days
22
1% of all-time downloads
All-time downloads
3.3K
Public
Parameters
494M
28 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors28 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of Qwen/Qwen2-0.5B-Instruct on the motherduckdb/duckdb-text2sql-25k dataset (first 10k rows).
The Qwen2-0.5B-Instruct-SQL-query-generator is a specialized model fine-tuned to generate SQL queries from natural language text prompts. This fine-tuning allows the model to better understand and convert text inputs into corresponding SQL queries, facilitating tasks such as data retrieval and database querying through natural language interfaces.
The model was fine-tuned on the motherduckdb/duckdb-text2sql-25k dataset, specifically using the first 10,000 rows. This dataset includes natural language questions and their corresponding SQL queries, providing a robust foundation for training a text-to-SQL model.
The evaluation data used for fine-tuning was a subset of the same dataset, ensuring consistency in training and evaluation metrics.
Github Code: https://github.com/omaratef3221/SQL_Query_Generator_llm/
The following hyperparameters were used during training:
learning_rate: 1e-4train_batch_size: 8save_steps: 1logging_steps: 500num_epochs: 5During the training process, the model was periodically evaluated to ensure it was learning effectively. The specific training metrics and results were logged for further analysis.
To use this model, simply load it from the Hugging Face Model Hub and provide natural language text prompts. The model will generate the corresponding SQL queries.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("omaratef3221/Qwen2-0.5B-Instruct-SQL-query-generator")
model = AutoModelForSeq2SeqLM.from_pretrained("omaratef3221/Qwen2-0.5B-Instruct-SQL-query-generator")
inputs = tokenizer("Show me all employees with a salary greater than $100,000", return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))