Model Card for Model ID

Model Details

Model Description

SmolLM-360M-text2sql is a fine-tuned transformer model optimized for text-to-SQL generation tasks. The model takes natural language queries and converts them into SQL statements, enabling seamless database interactions through natural language. It was fine-tuned using the 🤗 Hugging Face Transformers library.

  • Developed by: Aryann Tated
  • Model type: Transformer-based model, fine-tuned for text-to-SQL translation

Uses

Direct Use

Convert natural language questions into SQL queries for querying databases. Build user-friendly database query systems in applications such as business intelligence dashboards and customer support tools.

Downstream Use [optional]

  • Integration into conversational agents for querying structured datasets.
  • Automating SQL generation in educational or enterprise settings.

Out-of-Scope Use

  • Not intended for querying highly sensitive or confidential databases without proper safeguards.
  • Should not be used without verifying the output SQL queries for accuracy and security.

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoModelForCausalLM, AutoTokenizer

Load model and tokenizer

model_name = "aryanntated/SmolLM-360M-text2sql" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name)

Example usage

input_query = "How many employees were hired in 2023?" inputs = tokenizer(input_query, return_tensors="pt") outputs = model.generate(**inputs)

Decode and print the SQL query

generated_sql = tokenizer.decode(outputs[0], skip_special_tokens=True) print(generated_sql)

Model Card Contact

Email at - aryann.k.tated@gmail.com

Downloads last month
8
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support