Text Generation
Transformers
Safetensors
GGUF
English
qwen3_5_text
qwen
python
code-generation
qlora
sft
unsloth
conversational
Instructions to use jaweed123/Qwen3.5-0.8B-Python-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jaweed123/Qwen3.5-0.8B-Python-SFT") 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("jaweed123/Qwen3.5-0.8B-Python-SFT") model = AutoModelForCausalLM.from_pretrained("jaweed123/Qwen3.5-0.8B-Python-SFT", 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
- llama.cpp
How to use jaweed123/Qwen3.5-0.8B-Python-SFT 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 jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M # Run inference directly in the terminal: llama cli -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M # Run inference directly in the terminal: llama cli -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Use Docker
docker model run hf.co/jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jaweed123/Qwen3.5-0.8B-Python-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jaweed123/Qwen3.5-0.8B-Python-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
- SGLang
How to use jaweed123/Qwen3.5-0.8B-Python-SFT 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 "jaweed123/Qwen3.5-0.8B-Python-SFT" \ --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": "jaweed123/Qwen3.5-0.8B-Python-SFT", "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 "jaweed123/Qwen3.5-0.8B-Python-SFT" \ --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": "jaweed123/Qwen3.5-0.8B-Python-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with Ollama:
ollama run hf.co/jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
- Unsloth Desktop
- Pi
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with Docker Model Runner:
docker model run hf.co/jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
- Lemonade
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.5-0.8B-Python-SFT-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jaweed123/Qwen3.5-0.8B-Python-SFT with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "jaweed123/Qwen3.5-0.8B-Python-SFT:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.5-0.8B-Base
|
| 4 |
+
tags:
|
| 5 |
+
- qwen
|
| 6 |
+
- python
|
| 7 |
+
- code-generation
|
| 8 |
+
- qlora
|
| 9 |
+
- sft
|
| 10 |
+
- unsloth
|
| 11 |
+
- gguf
|
| 12 |
+
datasets:
|
| 13 |
+
- code-search-net/code_search_net
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
library_name: transformers
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Qwen3.5-0.8B-Python-SFT
|
| 21 |
+
|
| 22 |
+
**Python code generation model** — Qwen3.5-0.8B-Base fine-tuned with **QLoRA
|
| 23 |
+
(Supervised Fine-Tuning)** on **CodeSearchNet (Python)**: docstring → function
|
| 24 |
+
code pairs.
|
| 25 |
+
|
| 26 |
+
## Model Details
|
| 27 |
+
|
| 28 |
+
| Property | Value |
|
| 29 |
+
|----------|-------|
|
| 30 |
+
| Base model | [Qwen/Qwen3.5-0.8B-Base](https://huggingface.co/Qwen/Qwen3.5-0.8B-Base) |
|
| 31 |
+
| Method | QLoRA (4-bit base + LoRA r=16, alpha=32) |
|
| 32 |
+
| Trainable params | 6.4M / 759M (0.84%) |
|
| 33 |
+
| Dataset | CodeSearchNet Python — 408K samples (13,590 repos) |
|
| 34 |
+
| Task | Docstring → Python function code |
|
| 35 |
+
| Sequence length | 2048 |
|
| 36 |
+
| Precision | BF16 |
|
| 37 |
+
| Hardware | NVIDIA RTX 4060 8GB |
|
| 38 |
+
|
| 39 |
+
## Training Results
|
| 40 |
+
|
| 41 |
+
| Metric | Value |
|
| 42 |
+
|--------|-------|
|
| 43 |
+
| Train loss | 0.330 |
|
| 44 |
+
| Eval loss | 1.214 |
|
| 45 |
+
| Steps | 25,524 (1 epoch) |
|
| 46 |
+
| Runtime | ~25.7h |
|
| 47 |
+
|
| 48 |
+
## Evaluation
|
| 49 |
+
|
| 50 |
+
pass@1 (temperature 0.2), official test harness, both models in bf16.
|
| 51 |
+
|
| 52 |
+
| Benchmark | Base | **Fine-tuned** | Improvement |
|
| 53 |
+
|-----------|-----:|---------------:|------------:|
|
| 54 |
+
| HumanEval | 1.2% | **17.7%** | 14.5x |
|
| 55 |
+
| MBPP | 0.0% | 0.2% | 0 → 1 |
|
| 56 |
+
|
| 57 |
+
Full report with example solutions: `reports/evaluation_report.md` in the training repo.
|
| 58 |
+
|
| 59 |
+
## Training Details
|
| 60 |
+
|
| 61 |
+
- **Method:** QLoRA — 4-bit quantized base + LoRA (r=16, alpha=32, dropout=0)
|
| 62 |
+
- **Target modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 63 |
+
- **Optimizer:** adamw_8bit (bitsandbytes), cosine schedule, 3% warmup
|
| 64 |
+
- **Batch:** 2 per device × 8 grad accumulation (effective 16)
|
| 65 |
+
- **Max sequence length:** 2048
|
| 66 |
+
- **Hardware:** NVIDIA RTX 4060 8GB, ~25.7h
|
| 67 |
+
- **Data:** CodeSearchNet Python filtered to ≤2048 tokens (408,377 train samples)
|
| 68 |
+
|
| 69 |
+
## Usage
|
| 70 |
+
|
| 71 |
+
### Transformers (LoRA adapter)
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
from unsloth import FastLanguageModel
|
| 75 |
+
|
| 76 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 77 |
+
"Qwen/Qwen3.5-0.8B-Base",
|
| 78 |
+
max_seq_length=2048,
|
| 79 |
+
load_in_4bit=True,
|
| 80 |
+
)
|
| 81 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 82 |
+
"jaweed123/Qwen3.5-0.8B-Python-SFT",
|
| 83 |
+
max_seq_length=2048,
|
| 84 |
+
load_in_4bit=True,
|
| 85 |
+
)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
### GGUF (ollama / llama.cpp / vLLM)
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
# llama.cpp
|
| 92 |
+
llama-cli -m qwen3.5-0.8b-python-sft-q4_k_m.gguf -p "Write a Python function that..."
|
| 93 |
+
|
| 94 |
+
# Ollama
|
| 95 |
+
ollama create qwen3.5-python -f Modelfile
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
```dockerfile
|
| 99 |
+
# Modelfile
|
| 100 |
+
FROM qwen3.5-0.8b-python-sft-q4_k_m.gguf
|
| 101 |
+
TEMPLATE "{{ if .System }}<|im_start|>system
|
| 102 |
+
{{ .System }}<|im_end|>
|
| 103 |
+
{{ end }}<|im_start|>user
|
| 104 |
+
{{ .Prompt }}<|im_end|>
|
| 105 |
+
<|im_start|>assistant
|
| 106 |
+
"
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
## Files
|
| 110 |
+
|
| 111 |
+
| File | Description |
|
| 112 |
+
|------|-------------|
|
| 113 |
+
| `adapter_model.safetensors` | LoRA adapter (small, ~13MB) |
|
| 114 |
+
| `model.safetensors` | Merged 16-bit model |
|
| 115 |
+
| `qwen3.5-0.8b-python-sft-q4_k_m.gguf` | GGUF Q4_K_M (~0.5GB) |
|
| 116 |
+
| `qwen3.5-0.8b-python-sft-q8_0.gguf` | GGUF Q8_0 (~0.9GB) |
|
| 117 |
+
| `qwen3.5-0.8b-python-sft-f16.gguf` | GGUF F16 |
|
| 118 |
+
|
| 119 |
+
## Limitations
|
| 120 |
+
|
| 121 |
+
- Fine-tuned for Python function generation from docstrings
|
| 122 |
+
- Trained on 2019-era open-source code
|
| 123 |
+
- 0.8B scale — limited reasoning; best for straightforward code tasks
|