Instructions to use NumbersStation/nsql-6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NumbersStation/nsql-6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NumbersStation/nsql-6B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NumbersStation/nsql-6B") model = AutoModelForCausalLM.from_pretrained("NumbersStation/nsql-6B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NumbersStation/nsql-6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NumbersStation/nsql-6B" # 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-6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NumbersStation/nsql-6B
- SGLang
How to use NumbersStation/nsql-6B 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-6B" \ --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-6B", "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-6B" \ --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-6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NumbersStation/nsql-6B with Docker Model Runner:
docker model run hf.co/NumbersStation/nsql-6B
Is there way to connect to cloud database?
#3
by wasabijar - opened
In the repo, it provides examples to connect with the local database, how about the cloud database(i.e. GCP, AWS, Azure)?
Hello @wasabijar ,
We appreciate your interest in our work. Currently, we have plans to include cloud database examples in future releases. However, if you are interested in contributing to our NSQL codebase, we would be delighted to have you as a contributor.
Additionally, we would like to provide you with some references that you may find helpful:
- GCP Postgres: https://cloud.google.com/sql/docs/postgres/samples/cloud-sql-postgres-sqlalchemy-connect-connector
- AWS Redshift: https://docs.aws.amazon.com/redshift/latest/mgmt/python-connect-examples.html
- Azure database: https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-python?view=azuresql
senwu changed discussion status to closed