Text Generation
Transformers
Safetensors
English
qwen2
text-to-sql
spider-dataset
sql-generation
code-generation
master-thesis-research
conversational
text-generation-inference
Instructions to use ALI-USER/qwen2.5-coder-spider-sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ALI-USER/qwen2.5-coder-spider-sql with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ALI-USER/qwen2.5-coder-spider-sql") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ALI-USER/qwen2.5-coder-spider-sql") model = AutoModelForCausalLM.from_pretrained("ALI-USER/qwen2.5-coder-spider-sql") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ALI-USER/qwen2.5-coder-spider-sql with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ALI-USER/qwen2.5-coder-spider-sql" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ALI-USER/qwen2.5-coder-spider-sql", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ALI-USER/qwen2.5-coder-spider-sql
- SGLang
How to use ALI-USER/qwen2.5-coder-spider-sql 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 "ALI-USER/qwen2.5-coder-spider-sql" \ --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": "ALI-USER/qwen2.5-coder-spider-sql", "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 "ALI-USER/qwen2.5-coder-spider-sql" \ --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": "ALI-USER/qwen2.5-coder-spider-sql", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ALI-USER/qwen2.5-coder-spider-sql with Docker Model Runner:
docker model run hf.co/ALI-USER/qwen2.5-coder-spider-sql
Ali Assi commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -43,6 +43,18 @@ This model converts natural language questions into SQL queries by leveraging th
|
|
| 43 |
|
| 44 |
## Performance
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
**Overall Performance Summary**
|
| 47 |
|
| 48 |
The model achieved a **39.17% execution accuracy** on the Spider development set, correctly generating 405 out of 1,034 SQL queries. While this represents moderate performance, it demonstrates the model's capability to handle basic to intermediate SQL generation tasks across diverse database domains.
|
|
|
|
| 43 |
|
| 44 |
## Performance
|
| 45 |
|
| 46 |
+
### Performance Comparison
|
| 47 |
+
|
| 48 |
+
| Metric | Base Qwen Model | Fine-tuned Model |
|
| 49 |
+
|--------|----------------|------------------|
|
| 50 |
+
| **Total Queries** | 1,034 | 1,034 |
|
| 51 |
+
| **Execution Success** | 570 | 577 |
|
| 52 |
+
| **Execution Success Rate** | 55.1% | 55.8% |
|
| 53 |
+
| **Correct Results** | 357 | 405 |
|
| 54 |
+
| **Execution Accuracy** | 34.5% | 39.2% |
|
| 55 |
+
| **Parse Errors** | 464 | 457 |
|
| 56 |
+
| **Evaluation Time** | 84.9 min | 38.7 min |
|
| 57 |
+
|
| 58 |
**Overall Performance Summary**
|
| 59 |
|
| 60 |
The model achieved a **39.17% execution accuracy** on the Spider development set, correctly generating 405 out of 1,034 SQL queries. While this represents moderate performance, it demonstrates the model's capability to handle basic to intermediate SQL generation tasks across diverse database domains.
|