Instructions to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="duyntnet/sqlcoder-7b-2-imatrix-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("duyntnet/sqlcoder-7b-2-imatrix-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
Use Docker
docker model run hf.co/duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "duyntnet/sqlcoder-7b-2-imatrix-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "duyntnet/sqlcoder-7b-2-imatrix-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
- SGLang
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF 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 "duyntnet/sqlcoder-7b-2-imatrix-GGUF" \ --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": "duyntnet/sqlcoder-7b-2-imatrix-GGUF", "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 "duyntnet/sqlcoder-7b-2-imatrix-GGUF" \ --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": "duyntnet/sqlcoder-7b-2-imatrix-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with Ollama:
ollama run hf.co/duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with Docker Model Runner:
docker model run hf.co/duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
- Lemonade
How to use duyntnet/sqlcoder-7b-2-imatrix-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull duyntnet/sqlcoder-7b-2-imatrix-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.sqlcoder-7b-2-imatrix-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
File size: 1,177 Bytes
a637edd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ---
license: other
language:
- en
pipeline_tag: text-generation
inference: false
tags:
- transformers
- gguf
- imatrix
- sqlcoder-7b-2
---
Quantizations of https://huggingface.co/defog/sqlcoder-7b-2
# From original readme
## Uses
This model is intended to be used by non-technical users to understand data inside their SQL databases. It is meant as an analytics tool, and not as a database admin tool.
This model has not been trained to reject malicious requests from users with write access to databases, and should only be used by users with read-only access.
## How to Get Started with the Model
Use the code [here](https://github.com/defog-ai/sqlcoder/blob/main/inference.py) to get started with the model.
## Prompt
Please use the following prompt for optimal results. Please remember to use `do_sample=False` and `num_beams=4` for optimal results.
```
### Task
Generate a SQL query to answer [QUESTION]{user_question}[/QUESTION]
### Database Schema
The query will run on a database with the following schema:
{table_metadata_string_DDL_statements}
### Answer
Given the database schema, here is the SQL query that [QUESTION]{user_question}[/QUESTION]
[SQL]
``` |