rajaykumar12959/gemma-2-2b-sql-finetuned

Hugging Face
TEXT GENERATIONConcurrency Cost:1Model Size:2.6BQuant:BF16Ctx Length:8kLicense:apache-2.0Architecture:Transformer0.0K Open Weights Warm

The rajaykumar12959/gemma-2-2b-sql-finetuned model is a 2.6 billion parameter Gemma-2 architecture fine-tuned by rajaykumar12959 for Text-to-SQL generation. Utilizing QLoRA, it excels at converting natural language questions and database schemas into complex SQL queries, including multi-table JOINs, aggregations, and advanced filtering. This model is specifically optimized for generating accurate SQL from diverse natural language inputs, making it suitable for database interaction tasks.

Loading preview...

Model Overview

This model, developed by rajaykumar12959, is a Gemma-2-2B architecture fine-tuned using QLoRA for Text-to-SQL generation. It converts natural language questions and database schemas into SQL queries, leveraging the gretelai/synthetic_text_to_sql dataset for training. The fine-tuning process was optimized for speed using Unsloth and Huggingface's TRL library.

Key Capabilities

  • Generates complex SQL queries: Handles multi-table JOINs (INNER, LEFT, RIGHT), aggregation functions (SUM, COUNT, AVG, MIN, MAX), GROUP BY, HAVING clauses, and complex WHERE conditions.
  • Supports advanced SQL operations: Capable of generating subqueries, Common Table Expressions (CTEs), date/time operations, and string functions.
  • Efficient training: Fine-tuned with QLoRA, enabling efficient training on a single GPU with 8GB+ VRAM.

Good for

  • Automating SQL query generation: Ideal for applications requiring the conversion of natural language into executable SQL.
  • Database interaction tools: Can be integrated into tools that allow users to query databases using plain English.
  • Educational and research purposes: Provides a robust foundation for exploring Text-to-SQL capabilities and further fine-tuning.

Limitations

While proficient, the model's current training (100 steps for demo) suggests that increasing max_steps to 300+ is recommended for production use. It primarily supports standard SQL syntax and has a maximum sequence length of 2048 tokens. Highly complex nested queries may require additional fine-tuning.