Text Generation
Transformers
Safetensors
English
qwen2
text-to-sql
sql
conversational
text-generation-inference
Instructions to use AlioLeuchtmann/ALIO-SQL-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlioLeuchtmann/ALIO-SQL-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AlioLeuchtmann/ALIO-SQL-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AlioLeuchtmann/ALIO-SQL-7B") model = AutoModelForCausalLM.from_pretrained("AlioLeuchtmann/ALIO-SQL-7B") 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 AlioLeuchtmann/ALIO-SQL-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlioLeuchtmann/ALIO-SQL-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlioLeuchtmann/ALIO-SQL-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AlioLeuchtmann/ALIO-SQL-7B
- SGLang
How to use AlioLeuchtmann/ALIO-SQL-7B 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 "AlioLeuchtmann/ALIO-SQL-7B" \ --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": "AlioLeuchtmann/ALIO-SQL-7B", "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 "AlioLeuchtmann/ALIO-SQL-7B" \ --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": "AlioLeuchtmann/ALIO-SQL-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AlioLeuchtmann/ALIO-SQL-7B with Docker Model Runner:
docker model run hf.co/AlioLeuchtmann/ALIO-SQL-7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -45,12 +45,15 @@ After training, this checkpoint even exceeds the performance of its teacher mode
|
|
| 45 |
|
| 46 |
## Prompt:
|
| 47 |
|
|
|
|
|
|
|
| 48 |
```sql
|
| 49 |
CREATE TABLE geographic\n(\n city TEXT not null\n primary key,\n county TEXT null,\n region TEXT null\n) \n /* \n 2 example rows: \n SELECT * FROM geographic LIMIT 2; \n city county region \nalameda alameda county bay area \n alamo contra costa county bay area \n */\n\n <br>
|
| 50 |
CREATE TABLE generalinfo\n(\n id_restaurant INTEGER not null\n primary key,\n label TEXT null,\n food_type TEXT null,\n city TEXT null,\n review REAL null,\n foreign key (city) references geographic(city)\n on update cascade on delete cascade\n) \n /* \n 2 example rows: \n SELECT * FROM generalinfo LIMIT 2; \n id_restaurant label food_type city review \n 1 sparky's diner 24 hour diner san francisco 2.3 \n 2 kabul afghan cuisine afghani san carlos 3.8 \n */\n\nCREATE TABLE location\n(\n id_restaurant INTEGER not null\n primary key,\n street_num INTEGER null,\n street_name TEXT null,\n city TEXT null,\n foreign key (city) references geographic (city)\n on update cascade on delete cascade,\n foreign key (id_restaurant) references generalinfo (id_restaurant)\n on update cascade on delete cascade\n) \n /* \n 2 example rows: \n SELECT * FROM location LIMIT 2; \n id_restaurant street_num street_name city \n 1 242 church st san francisco \n 2 135 el camino real san carlos \n */\n\n <br>
|
| 51 |
-- External Knowledge: Atlantic Ave refers to street_name = 'atlantic ave'; rating refers to review\n <br>
|
| 52 |
-- Using valid SQLite and understanding External Knowledge, answer the following question for the tables provided above.\n <br>
|
| 53 |
-
-- What is the rating of each restaurant reviews on Atlantic Ave?\
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
|
|
@@ -68,4 +71,7 @@ You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
|
|
| 68 |
'''
|
| 69 |
```
|
| 70 |
|
|
|
|
|
|
|
|
|
|
| 71 |
|
|
|
|
| 45 |
|
| 46 |
## Prompt:
|
| 47 |
|
| 48 |
+
Single Prompt used throughout the Dataset so best used as follows:
|
| 49 |
+
|
| 50 |
```sql
|
| 51 |
CREATE TABLE geographic\n(\n city TEXT not null\n primary key,\n county TEXT null,\n region TEXT null\n) \n /* \n 2 example rows: \n SELECT * FROM geographic LIMIT 2; \n city county region \nalameda alameda county bay area \n alamo contra costa county bay area \n */\n\n <br>
|
| 52 |
CREATE TABLE generalinfo\n(\n id_restaurant INTEGER not null\n primary key,\n label TEXT null,\n food_type TEXT null,\n city TEXT null,\n review REAL null,\n foreign key (city) references geographic(city)\n on update cascade on delete cascade\n) \n /* \n 2 example rows: \n SELECT * FROM generalinfo LIMIT 2; \n id_restaurant label food_type city review \n 1 sparky's diner 24 hour diner san francisco 2.3 \n 2 kabul afghan cuisine afghani san carlos 3.8 \n */\n\nCREATE TABLE location\n(\n id_restaurant INTEGER not null\n primary key,\n street_num INTEGER null,\n street_name TEXT null,\n city TEXT null,\n foreign key (city) references geographic (city)\n on update cascade on delete cascade,\n foreign key (id_restaurant) references generalinfo (id_restaurant)\n on update cascade on delete cascade\n) \n /* \n 2 example rows: \n SELECT * FROM location LIMIT 2; \n id_restaurant street_num street_name city \n 1 242 church st san francisco \n 2 135 el camino real san carlos \n */\n\n <br>
|
| 53 |
-- External Knowledge: Atlantic Ave refers to street_name = 'atlantic ave'; rating refers to review\n <br>
|
| 54 |
-- Using valid SQLite and understanding External Knowledge, answer the following question for the tables provided above.\n <br>
|
| 55 |
+
-- What is the rating of each restaurant reviews on Atlantic Ave?\n <br>
|
| 56 |
+
Generate the SQL after thinking step by step:\n <br>
|
| 57 |
```
|
| 58 |
|
| 59 |
|
|
|
|
| 71 |
'''
|
| 72 |
```
|
| 73 |
|
| 74 |
+
### Generation Config:
|
| 75 |
+
- No Sampling for best Performance
|
| 76 |
+
|
| 77 |
|