Instructions to use support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ") model = AutoModelForCausalLM.from_pretrained("support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ
- SGLang
How to use support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ 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 "support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ" \ --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": "support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ", "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 "support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ" \ --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": "support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ with Docker Model Runner:
docker model run hf.co/support-pvelocity/Code-Llama-2-13B-instruct-text2sql-GPTQ
Commit ·
23f8d2d
1
Parent(s): 3383f0d
Update README.md
Browse files
README.md
CHANGED
|
@@ -52,6 +52,10 @@ This model is governed by a custom commercial license from Code Llama. For detai
|
|
| 52 |
## Example Code
|
| 53 |
|
| 54 |
You can use the Code-Llama-2-13B-instruct-text2sql-GPTQ model to generate SQL queries from natural language questions, as demonstrated in the following code snippet:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
```python
|
| 56 |
from transformers import AutoTokenizer
|
| 57 |
from auto_gptq import AutoGPTQForCausalLM
|
|
|
|
| 52 |
## Example Code
|
| 53 |
|
| 54 |
You can use the Code-Llama-2-13B-instruct-text2sql-GPTQ model to generate SQL queries from natural language questions, as demonstrated in the following code snippet:
|
| 55 |
+
```cmd
|
| 56 |
+
pip install -q transformers==4.35.0 torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 optimum==1.13.2 auto-gptq==0.4.2
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
```python
|
| 60 |
from transformers import AutoTokenizer
|
| 61 |
from auto_gptq import AutoGPTQForCausalLM
|