Instructions to use support-pvelocity/Code-Llama-2-7B-instruct-text2sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use support-pvelocity/Code-Llama-2-7B-instruct-text2sql with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="support-pvelocity/Code-Llama-2-7B-instruct-text2sql")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("support-pvelocity/Code-Llama-2-7B-instruct-text2sql") model = AutoModelForCausalLM.from_pretrained("support-pvelocity/Code-Llama-2-7B-instruct-text2sql") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use support-pvelocity/Code-Llama-2-7B-instruct-text2sql 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-7B-instruct-text2sql" # 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-7B-instruct-text2sql", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/support-pvelocity/Code-Llama-2-7B-instruct-text2sql
- SGLang
How to use support-pvelocity/Code-Llama-2-7B-instruct-text2sql 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-7B-instruct-text2sql" \ --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-7B-instruct-text2sql", "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-7B-instruct-text2sql" \ --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-7B-instruct-text2sql", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use support-pvelocity/Code-Llama-2-7B-instruct-text2sql with Docker Model Runner:
docker model run hf.co/support-pvelocity/Code-Llama-2-7B-instruct-text2sql
Commit ·
308f0f2
1
Parent(s): 53e49aa
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,18 +5,6 @@ datasets:
|
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
-
|
| 9 |
-
widget:
|
| 10 |
-
- text: "[INST] Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```: Schema: CREATE TABLE head (age INTEGER) Question: How many heads of the departments are older than 56 ? [/INST] Here is the SQLite query to answer to the question: How many heads of the departments are older than 56 ?: ```"
|
| 11 |
-
example_title: "Example 1"
|
| 12 |
-
- text: "[INST] Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```: Schema: CREATE TABLE people (first_name VARCHAR) Question: List the first names of people in alphabetical order? [/INST] Here is the SQLite query to answer to the question: List the first names of people in alphabetical order?: ```"
|
| 13 |
-
example_title: "Example 2"
|
| 14 |
-
- text: "[INST] Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```: Schema: CREATE TABLE weather (zip_code VARCHAR, mean_sea_level_pressure_inches INTEGER) Question: What is the zip code in which the average mean sea level pressure is the lowest? [/INST] Here is the SQLite query to answer to the question: What is the zip code in which the average mean sea level pressure is the lowest?: ```"
|
| 15 |
-
example_title: "Example 3"
|
| 16 |
-
- text: "[INST] Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```: Schema: CREATE TABLE weather (date VARCHAR, mean_temperature_f VARCHAR, mean_humidity VARCHAR, max_gust_speed_mph VARCHAR) Question: What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds? [/INST] Here is the SQLite query to answer to the question: What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?: ```"
|
| 17 |
-
example_title: "Example 4"
|
| 18 |
-
- text: "[INST] Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```: Schema: CREATE TABLE trip (end_station_id VARCHAR); CREATE TABLE station (id VARCHAR, city VARCHAR) Question: Count the number of trips that did not end in San Francisco city. [/INST] Here is the SQLite query to answer to the question: Count the number of trips that did not end in San Francisco city.: ```"
|
| 19 |
-
example_title: "Example 5"
|
| 20 |
|
| 21 |
---
|
| 22 |
# **Code-Llama-2-7B-instruct-text2sql Model Card**
|
|
|
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
---
|
| 10 |
# **Code-Llama-2-7B-instruct-text2sql Model Card**
|