Instructions to use gabrielpondc/NL2SQL-StarCoder-15B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gabrielpondc/NL2SQL-StarCoder-15B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gabrielpondc/NL2SQL-StarCoder-15B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gabrielpondc/NL2SQL-StarCoder-15B") model = AutoModelForCausalLM.from_pretrained("gabrielpondc/NL2SQL-StarCoder-15B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use gabrielpondc/NL2SQL-StarCoder-15B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gabrielpondc/NL2SQL-StarCoder-15B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gabrielpondc/NL2SQL-StarCoder-15B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gabrielpondc/NL2SQL-StarCoder-15B
- SGLang
How to use gabrielpondc/NL2SQL-StarCoder-15B 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 "gabrielpondc/NL2SQL-StarCoder-15B" \ --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": "gabrielpondc/NL2SQL-StarCoder-15B", "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 "gabrielpondc/NL2SQL-StarCoder-15B" \ --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": "gabrielpondc/NL2SQL-StarCoder-15B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gabrielpondc/NL2SQL-StarCoder-15B with Docker Model Runner:
docker model run hf.co/gabrielpondc/NL2SQL-StarCoder-15B
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,9 +12,9 @@ tasks:
|
|
| 12 |
|
| 13 |
# Model Card for NL2SQL-StarCoder-15B
|
| 14 |
|
| 15 |
-
##
|
| 16 |
|
| 17 |
-
NL2SQL-StarCoder-15B
|
| 18 |
|
| 19 |
## Requirements
|
| 20 |
|
|
@@ -22,9 +22,9 @@ NL2SQL-StarCoder-15B 是在基础模型 StarCoder 上通过 QLoRA 对自然语
|
|
| 22 |
- pytorch>=2.0.0
|
| 23 |
- transformers==4.32.0
|
| 24 |
- CUDA 11.4
|
| 25 |
-
##
|
| 26 |
|
| 27 |
-
|
| 28 |
```python
|
| 29 |
"""
|
| 30 |
<|user|>
|
|
@@ -35,15 +35,15 @@ CREATE TABLE "table_name" (
|
|
| 35 |
...
|
| 36 |
)
|
| 37 |
|
| 38 |
-
/* Write a sql to answer the following question: {
|
| 39 |
<|assistant|>
|
| 40 |
```sql
|
| 41 |
-
{
|
| 42 |
```<|end|>
|
| 43 |
"""
|
| 44 |
```
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
```python
|
| 49 |
import torch
|
|
|
|
| 12 |
|
| 13 |
# Model Card for NL2SQL-StarCoder-15B
|
| 14 |
|
| 15 |
+
## Model Inro
|
| 16 |
|
| 17 |
+
NL2SQL-StarCoder-15B is a NLP-SQL model fintuned by QLoRAbased on StarCoder 15B Code-LLM。
|
| 18 |
|
| 19 |
## Requirements
|
| 20 |
|
|
|
|
| 22 |
- pytorch>=2.0.0
|
| 23 |
- transformers==4.32.0
|
| 24 |
- CUDA 11.4
|
| 25 |
+
## Data Format
|
| 26 |
|
| 27 |
+
The data is in the form of a string spliced by the model in the training data format, which is also how the input PROMPT is spliced during inference:
|
| 28 |
```python
|
| 29 |
"""
|
| 30 |
<|user|>
|
|
|
|
| 35 |
...
|
| 36 |
)
|
| 37 |
|
| 38 |
+
/* Write a sql to answer the following question: {Question} */
|
| 39 |
<|assistant|>
|
| 40 |
```sql
|
| 41 |
+
{Output SQL}
|
| 42 |
```<|end|>
|
| 43 |
"""
|
| 44 |
```
|
| 45 |
|
| 46 |
+
## Quick Start
|
| 47 |
|
| 48 |
```python
|
| 49 |
import torch
|