Instructions to use NumbersStation/nsql-350M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NumbersStation/nsql-350M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NumbersStation/nsql-350M")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NumbersStation/nsql-350M") model = AutoModelForCausalLM.from_pretrained("NumbersStation/nsql-350M") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NumbersStation/nsql-350M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NumbersStation/nsql-350M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NumbersStation/nsql-350M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NumbersStation/nsql-350M
- SGLang
How to use NumbersStation/nsql-350M 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 "NumbersStation/nsql-350M" \ --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": "NumbersStation/nsql-350M", "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 "NumbersStation/nsql-350M" \ --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": "NumbersStation/nsql-350M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NumbersStation/nsql-350M with Docker Model Runner:
docker model run hf.co/NumbersStation/nsql-350M
Few questions from the blog
Hey NumbersStation team, congratulations for the work, finally an "open-source" FM specialized for text to sql conversion is available for the community due to your efforts. I had a few questions from the blog,
- Any plans for a research paper?
- Will the fine-tuning script be made available? From the blog, companies can use their own company data to enhance the NSQL models, so an example would be better.
- Any suggestions for the deployment and serving of these FMs? Especially the 6B model?
Hi @snehilsanyal ,
Thanks for your interest in our work! Please find the response to your questions below:
Any plans for a research paper?
We have a plan for that and we will share more insights of our text-to-SQL work.
Will the fine-tuning script be made available? From the blog, companies can use their own company data to enhance the NSQL models, so an example would be better.
We don't have a plan to release our fine-tuning script right now but we have released the text-to-SQL data we collected here along with NSQL models.
Any suggestions for the deployment and serving of these FMs? Especially the 6B model?
Deploying the 6B model requires around 16G GPU memory, so a 24G GPU should be efficient to deploy and serve the model.
Thank you @senwu for your reply.
The blog also mentioned that a future direction for this would be from "Textbooks are all you need" paper, which is a really interesting direction for the work. Excited to see how it goes :D
Many congratulations on the work