jaweed123 commited on
Commit
deb2aa4
·
verified ·
1 Parent(s): 6ea2c96

Add model card

Browse files
Files changed (1) hide show
  1. README.md +123 -0
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