Text Generation
Transformers
Safetensors
text-to-sql
spider-dataset
sqlifyai
code-generation
conversational
Instructions to use dattheshshenoy/sqlifyai-30min-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dattheshshenoy/sqlifyai-30min-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dattheshshenoy/sqlifyai-30min-test") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dattheshshenoy/sqlifyai-30min-test", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dattheshshenoy/sqlifyai-30min-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dattheshshenoy/sqlifyai-30min-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dattheshshenoy/sqlifyai-30min-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dattheshshenoy/sqlifyai-30min-test
- SGLang
How to use dattheshshenoy/sqlifyai-30min-test with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dattheshshenoy/sqlifyai-30min-test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dattheshshenoy/sqlifyai-30min-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dattheshshenoy/sqlifyai-30min-test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dattheshshenoy/sqlifyai-30min-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dattheshshenoy/sqlifyai-30min-test with Docker Model Runner:
docker model run hf.co/dattheshshenoy/sqlifyai-30min-test
File size: 1,340 Bytes
3485f2f fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 fbd1e85 01c7c85 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
---
license: apache-2.0
base_model: codellama/CodeLlama-7b-Instruct-hf
tags:
- text-to-sql
- spider-dataset
- sqlifyai
- code-generation
library_name: transformers
pipeline_tag: text-generation
---
# SQLifyAI - Text-to-SQL Model
This model was fine-tuned using SQLifyAI on the Spider dataset for converting natural language questions to SQL queries.
## Model Details
- **Base Model**: codellama/CodeLlama-7b-Instruct-hf
- **Dataset**: Spider
- **Training**: Multi-stage curriculum learning with advanced schema linking
- **Commit**: 30-minute rapid test training run
## Usage
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("dattheshshenoy/sqlifyai-30min-test")
model = AutoModelForCausalLM.from_pretrained("dattheshshenoy/sqlifyai-30min-test")
# Generate SQL
question = "What are the names of all students?"
schema = "CREATE TABLE students (id INT, name VARCHAR(50));"
prompt = f"### Question: {question}\n### Schema: {schema}\n### SQL:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128)
sql = tokenizer.decode(outputs[0], skip_special_tokens=True).split("### SQL:")[-1].strip()
```
## Performance
- Trained with advanced schema linking and curriculum learning
- Optimized for Spider dataset evaluation metrics
|