Text Generation
Transformers
PyTorch
gpt_bigcode
sql
spider
text-to-sql
sql finetune
8bit
text-generation-inference
8-bit precision
Instructions to use richardr1126/spider-skeleton-wizard-coder-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use richardr1126/spider-skeleton-wizard-coder-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="richardr1126/spider-skeleton-wizard-coder-8bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("richardr1126/spider-skeleton-wizard-coder-8bit") model = AutoModelForCausalLM.from_pretrained("richardr1126/spider-skeleton-wizard-coder-8bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use richardr1126/spider-skeleton-wizard-coder-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "richardr1126/spider-skeleton-wizard-coder-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "richardr1126/spider-skeleton-wizard-coder-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/richardr1126/spider-skeleton-wizard-coder-8bit
- SGLang
How to use richardr1126/spider-skeleton-wizard-coder-8bit 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 "richardr1126/spider-skeleton-wizard-coder-8bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "richardr1126/spider-skeleton-wizard-coder-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "richardr1126/spider-skeleton-wizard-coder-8bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "richardr1126/spider-skeleton-wizard-coder-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use richardr1126/spider-skeleton-wizard-coder-8bit with Docker Model Runner:
docker model run hf.co/richardr1126/spider-skeleton-wizard-coder-8bit
Commit ·
aa42541
1
Parent(s): 9469cf6
Update README.md
Browse files
README.md
CHANGED
|
@@ -28,6 +28,17 @@ The goal of the Spider challenge is to develop natural language interfaces to cr
|
|
| 28 |
|
| 29 |
This dataset was used to finetune this model.
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
## Citations
|
| 32 |
|
| 33 |
```
|
|
|
|
| 28 |
|
| 29 |
This dataset was used to finetune this model.
|
| 30 |
|
| 31 |
+
### Spider Skeleton WizardCoder - [test-suite-sql-eval](https://github.com/taoyds/test-suite-sql-eval) Results
|
| 32 |
+
With temperature set to 0.0, top_p set to 0.9, and top_k set to 0, the model achieves **61% execution accuracy** on the Spider dev set.
|
| 33 |
+
|
| 34 |
+
<img src="https://raw.githubusercontent.com/cuplv/text-to-sql-wizardcoder/main/eval/plots/spiderwizard-plus-chatgpt.svg" height="300">
|
| 35 |
+
<img src="https://raw.githubusercontent.com/cuplv/text-to-sql-wizardcoder/main/eval/plots/spiderwizard-vs-chatgpt.svg" height="300">
|
| 36 |
+
|
| 37 |
+
Note:
|
| 38 |
+
- ChatGPT was evaluated with the default hyperparameters and with the system message `You are a sophisticated AI assistant capable of converting text into SQL queries. You can only output SQL, don't add any other text.`
|
| 39 |
+
- Both models were evaluated with `--plug_value` in `evaluation.py` using the Spider dev set with database context.
|
| 40 |
+
- `--plug_value`: If set, the gold value will be plugged into the predicted query. This is suitable if your model does not predict values. This is set to `False` by default.
|
| 41 |
+
|
| 42 |
## Citations
|
| 43 |
|
| 44 |
```
|