Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
text-to-sql
sql
qwen
demo
vertex-ai
synthetic-data
conversational
Instructions to use Tuana/qwen35-08b-text2sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tuana/qwen35-08b-text2sql with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tuana/qwen35-08b-text2sql") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Tuana/qwen35-08b-text2sql") model = AutoModelForImageTextToText.from_pretrained("Tuana/qwen35-08b-text2sql") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Tuana/qwen35-08b-text2sql with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tuana/qwen35-08b-text2sql" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tuana/qwen35-08b-text2sql", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tuana/qwen35-08b-text2sql
- SGLang
How to use Tuana/qwen35-08b-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 "Tuana/qwen35-08b-text2sql" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tuana/qwen35-08b-text2sql", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Tuana/qwen35-08b-text2sql" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tuana/qwen35-08b-text2sql", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Tuana/qwen35-08b-text2sql with Docker Model Runner:
docker model run hf.co/Tuana/qwen35-08b-text2sql
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.5-0.8B
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- text-to-sql
|
| 8 |
+
- sql
|
| 9 |
+
- qwen
|
| 10 |
+
- demo
|
| 11 |
+
- vertex-ai
|
| 12 |
+
- synthetic-data
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# qwen35-08b-text2sql
|
| 16 |
+
|
| 17 |
+
`Tuana/qwen35-08b-text2sql` is a **demo Text-to-SQL model** fine-tuned from [`Qwen/Qwen3.5-0.8B`](https://huggingface.co/Qwen/Qwen3.5-0.8B).
|
| 18 |
+
|
| 19 |
+
It was fine-tuned on a small, specific synthetic SQL dataset for demonstration purposes. It is not intended to be a general Text-to-SQL model for arbitrary schemas or production databases.
|
| 20 |
+
|
| 21 |
+
## Model Details
|
| 22 |
+
|
| 23 |
+
- **Base model:** `Qwen/Qwen3.5-0.8B`
|
| 24 |
+
- **Task demo:** Text-to-SQL style SQL generation
|
| 25 |
+
- **Fine-tuning method:** LoRA SFT, merged into a full checkpoint
|
| 26 |
+
- **Training platform:** Google Cloud Vertex AI
|
| 27 |
+
- **Training container:** Hugging Face PyTorch Training Deep Learning Container
|
| 28 |
+
- **Dataset:** `Tuana/synthetic-sql-dataset`
|
| 29 |
+
- **Model format:** Merged `transformers` checkpoint
|
| 30 |
+
|
| 31 |
+
## What This Model Demonstrates
|
| 32 |
+
|
| 33 |
+
This model demonstrates a small fine-tuning workflow:
|
| 34 |
+
|
| 35 |
+
1. Generate a synthetic SQL instruction dataset
|
| 36 |
+
2. Fine-tune a small Qwen base model on Vertex AI
|
| 37 |
+
3. Merge the LoRA adapter into the base checkpoint
|
| 38 |
+
4. Serve or compare the result in a small demo app
|
| 39 |
+
|
| 40 |
+
The demo dataset uses a small synthetic database domain with tables such as:
|
| 41 |
+
|
| 42 |
+
- `department`
|
| 43 |
+
- `management`
|
| 44 |
+
- `head`
|
| 45 |
+
|
| 46 |
+
The model should be viewed as a demo artifact for this specific setup, not as a robust SQL assistant.
|
| 47 |
+
|
| 48 |
+
## Example Prompt Format
|
| 49 |
+
|
| 50 |
+
```text
|
| 51 |
+
Given this database schema:
|
| 52 |
+
CREATE TABLE department (
|
| 53 |
+
department_id VARCHAR,
|
| 54 |
+
name VARCHAR,
|
| 55 |
+
creation VARCHAR
|
| 56 |
+
);
|
| 57 |
+
CREATE TABLE management (
|
| 58 |
+
department_id VARCHAR,
|
| 59 |
+
head_id VARCHAR,
|
| 60 |
+
temporary_acting VARCHAR
|
| 61 |
+
);
|
| 62 |
+
CREATE TABLE head (
|
| 63 |
+
head_id VARCHAR,
|
| 64 |
+
name VARCHAR,
|
| 65 |
+
born_state VARCHAR
|
| 66 |
+
);
|
| 67 |
+
|
| 68 |
+
Write a SQL query for:
|
| 69 |
+
List all department names.
|
| 70 |
+
|
| 71 |
+
SQL:
|
| 72 |
+
```
|