Instructions to use parole-study-viper/gemma3-text-to-sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use parole-study-viper/gemma3-text-to-sql with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="parole-study-viper/gemma3-text-to-sql", filename="gemma-sql.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use parole-study-viper/gemma3-text-to-sql 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 parole-study-viper/gemma3-text-to-sql # Run inference directly in the terminal: llama cli -hf parole-study-viper/gemma3-text-to-sql
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf parole-study-viper/gemma3-text-to-sql # Run inference directly in the terminal: llama cli -hf parole-study-viper/gemma3-text-to-sql
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf parole-study-viper/gemma3-text-to-sql # Run inference directly in the terminal: ./llama-cli -hf parole-study-viper/gemma3-text-to-sql
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf parole-study-viper/gemma3-text-to-sql # Run inference directly in the terminal: ./build/bin/llama-cli -hf parole-study-viper/gemma3-text-to-sql
Use Docker
docker model run hf.co/parole-study-viper/gemma3-text-to-sql
- LM Studio
- Jan
- Ollama
How to use parole-study-viper/gemma3-text-to-sql with Ollama:
ollama run hf.co/parole-study-viper/gemma3-text-to-sql
- Unsloth Studio
How to use parole-study-viper/gemma3-text-to-sql with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for parole-study-viper/gemma3-text-to-sql to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for parole-study-viper/gemma3-text-to-sql to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for parole-study-viper/gemma3-text-to-sql to start chatting
- Atomic Chat new
- Docker Model Runner
How to use parole-study-viper/gemma3-text-to-sql with Docker Model Runner:
docker model run hf.co/parole-study-viper/gemma3-text-to-sql
- Lemonade
How to use parole-study-viper/gemma3-text-to-sql with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull parole-study-viper/gemma3-text-to-sql
Run and chat with the model
lemonade run user.gemma3-text-to-sql-{{QUANT_TAG}}List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,10 +10,8 @@ pipeline_tag: reinforcement-learning
|
|
| 10 |
tags:
|
| 11 |
- text-to-sql
|
| 12 |
---
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
library: gemma3-text-to-sql
|
| 16 |
-
---
|
| 17 |
# Gemma 3 Text-to-SQL
|
| 18 |
|
| 19 |
A powerful LoRA-fine-tuned adapter for Gemma 3 that converts natural language questions into SQL queries with high accuracy and contextual understanding.
|
|
@@ -58,7 +56,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
| 58 |
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 59 |
|
| 60 |
# Load adapter
|
| 61 |
-
adapter_path = "
|
| 62 |
model = PeftModel.from_pretrained(model, adapter_path)
|
| 63 |
|
| 64 |
# Format prompt
|
|
@@ -87,7 +85,7 @@ from mlx_lm.utils import get_model_path
|
|
| 87 |
|
| 88 |
# Setup paths
|
| 89 |
model_path = "lmstudio-community/gemma-3-27b-it-GGUF"
|
| 90 |
-
adapter_path = "
|
| 91 |
|
| 92 |
# Run generation
|
| 93 |
prompt = "Convert the following natural language query to SQL: Find all customers in New York"
|
|
@@ -108,7 +106,7 @@ You can also use the Hugging Face Inference API:
|
|
| 108 |
```python
|
| 109 |
import requests
|
| 110 |
|
| 111 |
-
API_URL = "https://api-inference.huggingface.co/models/
|
| 112 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 113 |
|
| 114 |
def query(payload):
|
|
@@ -214,11 +212,11 @@ If you use this model in your research or applications, please cite:
|
|
| 214 |
|
| 215 |
```bibtex
|
| 216 |
@misc{gemma3-text-to-sql,
|
| 217 |
-
author = {
|
| 218 |
title = {Gemma 3 Text-to-SQL: A LoRA-fine-tuned adapter for natural language to SQL conversion},
|
| 219 |
year = {2025},
|
| 220 |
publisher = {HuggingFace},
|
| 221 |
-
howpublished = {\url{https://huggingface.co/
|
| 222 |
}
|
| 223 |
```
|
| 224 |
|
|
@@ -235,4 +233,4 @@ We thank Google for releasing the Gemma 3 models and the Hugging Face team for t
|
|
| 235 |
If you find any issues or have suggestions for improvement, please open an issue on the GitHub repository or reach out on the Hugging Face community forums.
|
| 236 |
|
| 237 |
|
| 238 |
-
|
|
|
|
| 10 |
tags:
|
| 11 |
- text-to-sql
|
| 12 |
---
|
| 13 |
+
library: gemma3-text-to-sql
|
| 14 |
+
---
|
|
|
|
|
|
|
| 15 |
# Gemma 3 Text-to-SQL
|
| 16 |
|
| 17 |
A powerful LoRA-fine-tuned adapter for Gemma 3 that converts natural language questions into SQL queries with high accuracy and contextual understanding.
|
|
|
|
| 56 |
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 57 |
|
| 58 |
# Load adapter
|
| 59 |
+
adapter_path = "parole-study-viper/gemma-3-text-to-sql" # Replace with your HF model path
|
| 60 |
model = PeftModel.from_pretrained(model, adapter_path)
|
| 61 |
|
| 62 |
# Format prompt
|
|
|
|
| 85 |
|
| 86 |
# Setup paths
|
| 87 |
model_path = "lmstudio-community/gemma-3-27b-it-GGUF"
|
| 88 |
+
adapter_path = "parole-study-viper/gemma-3-text-to-sql/adapter_model.safetensors"
|
| 89 |
|
| 90 |
# Run generation
|
| 91 |
prompt = "Convert the following natural language query to SQL: Find all customers in New York"
|
|
|
|
| 106 |
```python
|
| 107 |
import requests
|
| 108 |
|
| 109 |
+
API_URL = "https://api-inference.huggingface.co/models/parole-study-viper/gemma-3-text-to-sql"
|
| 110 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 111 |
|
| 112 |
def query(payload):
|
|
|
|
| 212 |
|
| 213 |
```bibtex
|
| 214 |
@misc{gemma3-text-to-sql,
|
| 215 |
+
author = {parole-study-viper},
|
| 216 |
title = {Gemma 3 Text-to-SQL: A LoRA-fine-tuned adapter for natural language to SQL conversion},
|
| 217 |
year = {2025},
|
| 218 |
publisher = {HuggingFace},
|
| 219 |
+
howpublished = {\url{https://huggingface.co/parole-study-viper/gemma-3-text-to-sql}}
|
| 220 |
}
|
| 221 |
```
|
| 222 |
|
|
|
|
| 233 |
If you find any issues or have suggestions for improvement, please open an issue on the GitHub repository or reach out on the Hugging Face community forums.
|
| 234 |
|
| 235 |
|
| 236 |
+
This model created by [@parole-study-viper]
|