Text Generation
Transformers
Safetensors
qwen2
text-to-sql
reinforcement-learning
conversational
text-generation-inference
Instructions to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct") model = AutoModelForCausalLM.from_pretrained("cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct
- SGLang
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct 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 "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct" \ --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": "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct", "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 "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct" \ --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": "cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct with Docker Model Runner:
docker model run hf.co/cycloneboy/CscSQL-Merge-Qwen2.5-Coder-1.5B-Instruct
Improve model card: Add prominent GitHub link and sample usage
Browse filesThis PR improves the model card for SLM-SQL by:
- Adding a prominent link to the GitHub repository (`https://github.com/CycloneBoy/slm_sql`) in the "Important Links" section, making it easier for users to find the code.
- Incorporating a clear sample usage example to demonstrate how to load and run the model using the `transformers` library, which significantly enhances user accessibility.
1234567891011121314151617181935 unmodified lines555657585960---pipeline_tag: text-generationlibrary_name: transformerslicense: cc-by-nc-4.0tags:- text-to-sql- reinforcement-learning---# SLM-SQL: An Exploration of Small Language Models for Text-to-SQL### Important Links๐[Arxiv Paper](https://arxiv.org/abs/2507.22478) |๐ค[HuggingFace](https://huggingface.co/collections/cycloneboy/slm-sql-688b02f99f958d7a417658dc) |๐ค[ModelScope](https://modelscope.cn/collections/SLM-SQL-624bb6a60e9643) |## News35 unmodified lines<img src="https://raw.githubusercontent.com/CycloneBoy/slm_sql/main/data/image/slmsql_ablation_study.png" height="300" alt="slmsql_ablation_study">## Model| **Model** | Base Model | Train Method | Modelscope | HuggingFace |12345678910111213141516171835 unmodified lines545556575859606162636465666768697071727374757677787980818283848586---library_name: transformerslicense: cc-by-nc-4.0pipeline_tag: text-generationtags:- text-to-sql- reinforcement-learning---# SLM-SQL: An Exploration of Small Language Models for Text-to-SQL### Important Links๐[Arxiv Paper](https://arxiv.org/abs/2507.22478) | ๐พ[GitHub](https://github.com/CycloneBoy/slm_sql) |๐ค[HuggingFace Collection](https://huggingface.co/collections/cycloneboy/slm-sql-688b02f99f958d7a417658dc) |๐ค[ModelScope](https://modelscope.cn/collections/SLM-SQL-624bb6a60e9643) |## News35 unmodified lines<img src="https://raw.githubusercontent.com/CycloneBoy/slm_sql/main/data/image/slmsql_ablation_study.png" height="300" alt="slmsql_ablation_study">## Sample UsageYou can use the model with the `transformers` library. Here's an example:```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMimport torch# Load the tokenizer and model (e.g., SLM-SQL-1.5B)model_name = "cycloneboy/SLM-SQL-1.5B" # Adjust this to the specific model you want to usetokenizer = AutoTokenizer.from_pretrained(model_name)model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")# Define the input prompt (natural language question for SQL)prompt = "what are the names of all employees?"# Prepare the input for the modelinput_ids = tokenizer.encode(prompt, return_tensors="pt").to(model.device)# Generate the SQL queryoutput_ids = model.generate(input_ids, max_new_tokens=100, num_beams=1, do_sample=False)generated_sql = tokenizer.decode(output_ids[0], skip_special_tokens=True)print("Generated SQL Query:")print(generated_sql)```## Model| **Model** | Base Model | Train Method | Modelscope | HuggingFace |
README.md+30-4