sandeeprdy1729 commited on
Commit
236e77a
ยท
verified ยท
1 Parent(s): 4e862fc

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +145 -13
README.md CHANGED
@@ -1,21 +1,153 @@
1
  ---
2
- base_model: unsloth/qwen2.5-coder-0.5b-instruct-bnb-4bit
3
- tags:
4
- - text-generation-inference
5
- - transformers
6
- - unsloth
7
- - qwen2
8
- license: apache-2.0
9
  language:
10
  - en
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- # Uploaded finetuned model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- - **Developed by:** sandeeprdy1729
16
- - **License:** apache-2.0
17
- - **Finetuned from model :** unsloth/qwen2.5-coder-0.5b-instruct-bnb-4bit
18
 
19
- This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
20
 
21
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
1
  ---
 
 
 
 
 
 
 
2
  language:
3
  - en
4
+ license: apache-2.0
5
+ base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct
6
+ tags:
7
+ - code
8
+ - bug-fixing
9
+ - code-review
10
+ - qwen2
11
+ - lora
12
+ - mlx
13
+ - ollama
14
+ - chatml
15
+ pipeline_tag: text-generation
16
+ library_name: transformers
17
  ---
18
 
19
+ # TIMPS-Coder v3 โ€” Elite Bug-Fixing Assistant (0.5B)
20
+
21
+ > A 0.5B parameter coding model fine-tuned to **think before it codes** โ€” specialising in bug
22
+ > analysis, code review, algorithm problem-solving, and agentic planning.
23
+ > Built by [Sandeep Reddy](https://github.com/Sandeeprdy1729) ยท TIMPS ยท Made in India ๐Ÿ‡ฎ๐Ÿ‡ณ
24
+
25
+ [![HuggingFace](https://img.shields.io/badge/HuggingFace-TIMPS--Coder--0.5B-yellow)](https://huggingface.co/sandeeprdy1729/TIMPS-Coder-0.5B)
26
+ [![Ollama](https://img.shields.io/badge/Ollama-sandeeprdy1729%2Ftimps--coder-blue)](https://ollama.com/sandeeprdy1729/timps-coder)
27
+ [![License](https://img.shields.io/badge/license-Apache%202.0-green)](LICENSE)
28
+ [![Benchmark](https://img.shields.io/badge/Internal%20Benchmark-88%25%20(44%2F50)-brightgreen)](https://github.com/Sandeeprdy1729/TIMPS-Coder/blob/main/benchmark_results.json)
29
+
30
+ ## Model Summary
31
+
32
+ | Field | Value |
33
+ |---|---|
34
+ | **Base model** | `Qwen/Qwen2.5-Coder-0.5B-Instruct` (Alibaba Cloud) |
35
+ | **Architecture** | Qwen2 Transformer โ€” 494M parameters |
36
+ | **Fine-tuning method** | LoRA (rank=16, 16 layers) via MLX-LM |
37
+ | **Context window** | 4096 tokens |
38
+ | **Quantization** | Q4_K_M GGUF (Ollama) / BF16 safetensors (HuggingFace) |
39
+ | **Chat template** | ChatML (`<|im_start|>` / `<|im_end|>`) |
40
+ | **License** | Apache 2.0 |
41
+ | **Training hardware** | Apple M-series (Mac M1/M2/M3, 8 GB RAM) |
42
+
43
+ ## Benchmark Results โ€” 25 Tests, 5 Dimensions
44
+
45
+ Evaluated on [3_benchmark_ollama.py](https://github.com/Sandeeprdy1729/TIMPS-Coder/blob/main/3_benchmark_ollama.py).
46
+ Scoring: **2 pts** = complete correct answer with code ยท **1 pt** = partial ยท **0** = wrong/refused.
47
+
48
+ | Dimension | Score | % |
49
+ |---|---|---|
50
+ | ๐Ÿ› Bug Fix | 9 / 10 | **90%** |
51
+ | ๐Ÿ”ง SWE / Repo-level | 9 / 10 | **90%** |
52
+ | โšก Algorithms | 9 / 10 | **90%** |
53
+ | ๐Ÿ” Code Review | 8 / 10 | **80%** |
54
+ | ๐Ÿค– Agentic Reasoning | 9 / 10 | **90%** |
55
+ | **TOTAL** | **44 / 50** | **88%** |
56
+
57
+ ## Quick Start
58
+
59
+ ### Ollama (recommended)
60
+
61
+ ```bash
62
+ ollama pull sandeeprdy1729/timps-coder
63
+ ollama run sandeeprdy1729/timps-coder
64
+ ```
65
+
66
+ ### Python (Transformers)
67
+
68
+ ```python
69
+ from transformers import AutoModelForCausalLM, AutoTokenizer
70
+
71
+ model = AutoModelForCausalLM.from_pretrained("sandeeprdy1729/TIMPS-Coder-0.5B")
72
+ tokenizer = AutoTokenizer.from_pretrained("sandeeprdy1729/TIMPS-Coder-0.5B")
73
+
74
+ messages = [
75
+ {"role": "system", "content": "You are TIMPS-Coder v3. THINK through the root cause, FIX with complete code, VERIFY edge cases."},
76
+ {"role": "user", "content": "Fix: `data['user']['email']` throws KeyError when email is absent."},
77
+ ]
78
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
79
+ inputs = tokenizer(text, return_tensors="pt")
80
+ out = model.generate(**inputs, max_new_tokens=700, temperature=0.1, do_sample=True)
81
+ print(tokenizer.decode(out[0], skip_special_tokens=True))
82
+ ```
83
+
84
+ ### MLX (Mac Apple Silicon)
85
+
86
+ ```bash
87
+ pip install mlx-lm
88
+ mlx_lm.generate \
89
+ --model sandeeprdy1729/TIMPS-Coder-0.5B \
90
+ --max-tokens 700 --temp 0.1 \
91
+ --prompt '<|im_start|>system
92
+ You are TIMPS-Coder v3. THINK through the root cause, FIX with complete code, VERIFY edge cases.<|im_end|>
93
+ <|im_start|>user
94
+ Fix the race condition: two threads increment self.count += 1 simultaneously.<|im_end|>
95
+ <|im_start|>assistant
96
+ '
97
+ ```
98
+
99
+ ## Training Details
100
+
101
+ ### Fine-tuning Configuration
102
+
103
+ | Parameter | Value |
104
+ |---|---|
105
+ | Base model | `Qwen/Qwen2.5-Coder-0.5B-Instruct` |
106
+ | Fine-tuning method | LoRA (Supervised Fine-Tuning) |
107
+ | LoRA rank | 16 |
108
+ | Learning rate | 5e-6 |
109
+ | Iterations | 3,000 |
110
+ | Batch size | 1 (grad accum ร—4) |
111
+ | Max sequence length | 2048 tokens |
112
+ | Framework | MLX-LM on Apple Silicon |
113
+ | Peak RAM | ~5.5 GB |
114
+
115
+ ### Training Data
116
+
117
+ | Dataset | Type | Approx. Samples |
118
+ |---|---|---|
119
+ | `newfacade/LeetCodeDataset` | Algorithm problems with solutions | ~2,500 |
120
+ | `SWE-bench/SWE-bench_Verified` | Real GitHub issue โ†’ patch | ~400 |
121
+ | `TIGER-Lab/SWE-Next-SFT-Trajectories` | Agentic edit traces | ~2,000 |
122
+ | `WaltonFuture/agentic-sft-new` | Tool use + bash planning | ~3,000 |
123
+ | Custom TIMPS bug-fix corpus | Hand-curated bug/fix pairs | ~500 |
124
+ | **Total** | | **~8,400 samples** |
125
+
126
+ All samples formatted in ChatML with `THINK โ†’ FIX โ†’ VERIFY` answer structure.
127
+
128
+ ## Capabilities
129
+
130
+ | Does well | Limitations |
131
+ |---|---|
132
+ | Bug root-cause analysis with explanation | Complex multi-file refactors |
133
+ | SQL injection, race condition, memory leak detection | May miss subtle business-logic bugs |
134
+ | O-notation analysis and algorithm optimisation | Not a replacement for static analysis tools |
135
+ | LeetCode medium-level algorithm problems | Hard competitive programming problems |
136
+ | GitHub Actions / CI YAML generation | Not trained on Terraform, CDK |
137
+
138
+ ## Usage Tips
139
+
140
+ - **Temperature**: Keep at `0.1` โ€” higher values increase hallucination on a 0.5B model
141
+ - **Context**: Include the full function/class when asking for a bug fix
142
+ - **Verification**: Always test generated code. Even at 88% accuracy, edge cases exist
143
+ - **System prompt**: Required for best results โ€” see the Quick Start examples above
144
+
145
+ ## Training Code
146
 
147
+ Full training pipeline available at:
148
+ [https://github.com/Sandeeprdy1729/TIMPS-Coder](https://github.com/Sandeeprdy1729/TIMPS-Coder)
 
149
 
150
+ ## License
151
 
152
+ Apache 2.0 โ€” free to use, modify, and distribute commercially.
153
+ Base model (Qwen2.5-Coder-0.5B-Instruct) is also Apache 2.0.