b-mc2/sql-create-context
Viewer • Updated • 78.6k • 3.63k • 500
How to use alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx")
model = AutoModelForCausalLM.from_pretrained("alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx")How to use alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx
How to use alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx" \
--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": "alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx" \
--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": "alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx with Docker Model Runner:
docker model run hf.co/alwint3r/TinyLlama-1.1B-Chat-v0.1-sql-create-context-mlx
This model was fine-tuned to generate SQL queries from natural language questions given the context of a table DDL.
See original models here.
See the sql-create-context dataset here.
Example prompt:
### SQL Table Context: CREATE TABLE table_2249029_1 (gdp_world_rank VARCHAR, asian_rank VARCHAR)
### Human: Name the gdp world rank for asian rank being 15
Example response:
### Assistant: SELECT gdp_world_rank FROM table_2249029_1 WHERE asian_rank = "15"