Downloads · 30 days
12
24% of all-time downloads
RichardErkhov/Omaratef3221_-_Qwen2-0.5B-Instruct-SQL-query-generator-8bits
Omaratef3221_-_Qwen2-0.5B-Instruct-SQL-query-generator-8bits is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
12
24% of all-time downloads
All-time downloads
50
Public
Parameters
494M
632 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors632 MB · 98%
How the weights are stored.
I8358M · 72%
From the Hugging Face model README
Quantization made by Richard Erkhov.
Qwen2-0.5B-Instruct-SQL-query-generator - bnb 8bits
license: apache-2.0 base_model: Qwen/Qwen2-0.5B-Instruct tags:
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))