Text Generation
Transformers
Safetensors
JAX
PyTorch
English
llama
code
sql
text2sql
instruction_tuned
1b
expert
text-generation-inference
Instructions to use PipableAI/pip-SQL-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PipableAI/pip-SQL-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PipableAI/pip-SQL-1B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-SQL-1B") model = AutoModelForCausalLM.from_pretrained("PipableAI/pip-SQL-1B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PipableAI/pip-SQL-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PipableAI/pip-SQL-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PipableAI/pip-SQL-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PipableAI/pip-SQL-1B
- SGLang
How to use PipableAI/pip-SQL-1B 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 "PipableAI/pip-SQL-1B" \ --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": "PipableAI/pip-SQL-1B", "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 "PipableAI/pip-SQL-1B" \ --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": "PipableAI/pip-SQL-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PipableAI/pip-SQL-1B with Docker Model Runner:
docker model run hf.co/PipableAI/pip-SQL-1B
Update README.md
Browse files
README.md
CHANGED
|
@@ -47,6 +47,7 @@ text = """<schema>{schema}</schema>
|
|
| 47 |
<question>{question}</question>
|
| 48 |
<sql>"""
|
| 49 |
```
|
|
|
|
| 50 |
|
| 51 |
```python
|
| 52 |
from transformers import AutoModelForCasualLM, AutoTokenizer
|
|
@@ -58,6 +59,14 @@ inputs = tokenizer(text, return_tensors="pt")
|
|
| 58 |
outputs = model.generate(**inputs, max_new_tokens=200)
|
| 59 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True).split('<sql>')[1].split('</sql>')[0])
|
| 60 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
## The PipableAI team
|
| 63 |
|
|
|
|
| 47 |
<question>{question}</question>
|
| 48 |
<sql>"""
|
| 49 |
```
|
| 50 |
+
pytorch
|
| 51 |
|
| 52 |
```python
|
| 53 |
from transformers import AutoModelForCasualLM, AutoTokenizer
|
|
|
|
| 59 |
outputs = model.generate(**inputs, max_new_tokens=200)
|
| 60 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True).split('<sql>')[1].split('</sql>')[0])
|
| 61 |
```
|
| 62 |
+
flax
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from transformers import AutoModelForCasualLM, AutoTokenizer
|
| 66 |
+
device = "cuda"
|
| 67 |
+
model = FlaxAutoModelForCausalLM.from_pretrained("PipableAI/pipSQL1b" , from_pt=True)
|
| 68 |
+
tokenizer = AutoTokenizer.from_pretrained("PipableAI/pipSQL1b")
|
| 69 |
+
```
|
| 70 |
|
| 71 |
## The PipableAI team
|
| 72 |
|