erdemozkan commited on
Commit
d38045e
·
verified ·
1 Parent(s): 4cbdb87

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +92 -76
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  language:
3
  - en
4
- license: apache-2.0
5
  base_model: Qwen/Qwen2.5-Coder-7B-Instruct
6
  tags:
7
  - qwen2.5
@@ -9,26 +9,27 @@ tags:
9
  - code
10
  - cli
11
  - debugging
 
12
  - lora
 
 
 
13
  model-index:
14
- - name: YOLO-7B-Qwen-Coder
15
  results: []
16
- library_name: mlx
17
  ---
18
 
19
- <center><img src="https://cdn-uploads.huggingface.co/production/uploads/69518ec2b519522f5659da57/tEU3vljyhBNa5PTxPwUWa.png" width="500"></center>
20
 
21
- # YOLO-7B-Qwen-Coder
22
 
23
- A fine-tuned version of [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct) specialized in diagnosing CLI errors and generating a single, precise bash fix command.
24
-
25
- Part of the [yolo-coder](https://github.com/erdemozkan/yolo-coder) project — an automated CLI repair tool that wraps any command, catches failures, and fixes them locally using a local LLM.
26
 
27
  ---
28
 
29
  ## What it does
30
 
31
- Given a CLI error message and surrounding code context, the model outputs **exactly one bare bash command** to fix the problem. No explanation. No markdown. No backticks. Just the fix.
32
 
33
  ```
34
  Input: ModuleNotFoundError: No module named 'requests'
@@ -36,12 +37,44 @@ Output: pip install requests
36
  ```
37
 
38
  ```
39
- Input: IndexError: list index out of range (line 7: print(items[2]))
40
- Output: python3 yoco_replace.py app.py 7 'print(items[1])'
 
 
 
 
 
 
 
41
  ```
42
 
43
  ---
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  ## Model Details
46
 
47
  | Property | Value |
@@ -51,34 +84,24 @@ Output: python3 yoco_replace.py app.py 7 'print(items[1])'
51
  | LoRA rank | 8 |
52
  | LoRA scale | 20.0 |
53
  | Layers trained | 28 |
54
- | Training iterations | 800 |
55
- | Learning rate | 5e-6 |
56
- | Batch size | 2 (grad accumulation × 4 = effective 8) |
57
- | Max sequence length | 1024 |
58
- | Training hardware | Apple Silicon M-series (16GB) |
59
- | Final train loss | 0.217 |
60
- | Final val loss | 0.260 |
 
61
 
62
  ---
63
 
64
  ## Training Data
65
 
66
- Trained on a custom dataset of **2,250 CLI error/fix pairs** covering:
67
 
68
- - Python: `SyntaxError`, `ImportError`, `ModuleNotFoundError`, `AttributeError`, `IndexError`, `KeyError`, `TypeError`, `ZeroDivisionError`, `PermissionError`, `FileNotFoundError`
69
- - pip: missing packages, `--break-system-packages`, hash mismatches, permissions
70
- - Node.js: `Cannot find module`, `MODULE_NOT_FOUND`
71
- - npm: `ENOENT`, `ERESOLVE`, `EACCES`
72
- - TypeScript: `TS2304`, `TS2339`
73
- - Docker: image not found, port conflicts, container name collisions, daemon not running
74
- - Git: merge conflicts, detached HEAD, push rejected, not a repo
75
- - Web frameworks: Next.js, FastAPI, Flask, Express
76
- - Auth errors: JWT, OAuth, session issues
77
- - Async/CORS errors
78
 
79
- Format: ChatML with a strict system prompt enforcing single-command output.
80
-
81
- 90/10 train/validation split → 2025 train, 225 validation examples.
82
 
83
  ---
84
 
@@ -86,63 +109,38 @@ Format: ChatML with a strict system prompt enforcing single-command output.
86
 
87
  | File | Description |
88
  |---|---|
89
- | `YOLO-7B-Qwen-q4.gguf` | Q4_K_M quantized GGUF (~4.4GB) — recommended for Ollama |
90
- | `YOLO-7B-Qwen-finetuned.gguf` | f16 GGUF (~14GB) — full quality, for requantization |
91
  | `safetensors/` | fp16 HuggingFace safetensors — for further fine-tuning |
92
- | `adapter/` | Raw LoRA adapter weights (MLX format) |
93
 
94
  ---
95
 
96
- ## Usage with Ollama
97
 
98
  ```bash
99
- # Download the Modelfile
100
- curl -O https://raw.githubusercontent.com/erdemozkan/yolo-coder/main/YOLO-MODEL-FILES/Modelfile-7B
101
-
102
- # Pull the GGUF and register
103
- ollama create yolo-7b -f Modelfile-7B
104
 
105
  # Test it
106
- ollama run yolo-7b "ModuleNotFoundError: No module named 'flask'"
107
  # → pip install flask
108
  ```
109
 
110
  ---
111
 
112
- ## Usage with yolo-coder
113
 
114
  ```bash
115
- git clone https://github.com/erdemozkan/yolo-coder
116
- cd yolo-coder
117
- pip install -e .
118
-
119
- # Use the 7B model
120
- yoco --model yolo-7b python3 myapp.py
121
- ```
122
-
123
- ---
124
-
125
- ## Usage with Transformers
126
-
127
- ```python
128
- from transformers import AutoModelForCausalLM, AutoTokenizer
129
 
130
- model_id = "erdemozkan/YOLO-7B-Qwen-Coder"
131
- tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder="safetensors")
132
- model = AutoModelForCausalLM.from_pretrained(model_id, subfolder="safetensors")
133
 
134
- messages = [
135
- {"role": "system", "content": "You are a CLI repair tool. Output ONLY a single bare bash command to fix the error. No explanation. No markdown. No backticks."},
136
- {"role": "user", "content": "ModuleNotFoundError: No module named 'requests'"}
137
- ]
138
-
139
- text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
140
- inputs = tokenizer(text, return_tensors="pt")
141
- outputs = model.generate(**inputs, max_new_tokens=64, temperature=0.1)
142
- print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
143
- # → pip install requests
144
  ```
145
 
 
 
146
  ---
147
 
148
  ## Prompt Format (ChatML)
@@ -151,21 +149,39 @@ print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_t
151
  <|im_start|>system
152
  You are a CLI repair tool. Output ONLY a single bare bash command to fix the error. No explanation. No markdown. No backticks.<|im_end|>
153
  <|im_start|>user
154
- {error message}
155
- <|im_end|>
 
 
156
  <|im_start|>assistant
 
157
  ```
158
 
159
  ---
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  ## Limitations
162
 
163
- - Outputs a single command only — not suitable for multi-step fixes without a wrapper
164
- - Trained on common CLI errors; rare or highly domain-specific errors will fall back to base model behavior
165
- - Not a general coding assistant — use base Qwen2.5-Coder for that
166
 
167
  ---
168
 
169
  ## License
170
 
171
- Apache 2.0 — same as the base model.
 
1
  ---
2
  language:
3
  - en
4
+ license: mit
5
  base_model: Qwen/Qwen2.5-Coder-7B-Instruct
6
  tags:
7
  - qwen2.5
 
9
  - code
10
  - cli
11
  - debugging
12
+ - developer-tools
13
  - lora
14
+ - mlx
15
+ - gguf
16
+ - ollama
17
  model-index:
18
+ - name: YOLO-Coder-8B
19
  results: []
 
20
  ---
21
 
22
+ # YOLO-Coder-8B
23
 
24
+ A fine-tuned version of [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct) specialized in diagnosing CLI errors and generating a single, precise bash fix command. Runs on any machine with 6GB free RAM. Responds in 1–3s on Apple Silicon.
25
 
26
+ The **high-accuracy sibling** of [YOLO-Coder-1.5B](https://huggingface.co/erdemozkan/YOLO-Coder-1.5B). Part of the [YOLO-CODER](https://github.com/erdemozkan/YOLO-CODER) project an automated CLI repair tool that wraps any command, catches failures, and fixes them locally using a three-layer pipeline: deterministic interceptors → fix memory → local LLM.
 
 
27
 
28
  ---
29
 
30
  ## What it does
31
 
32
+ Given a CLI error message, the model outputs **exactly one bare bash command** to fix the problem. No explanation. No markdown. No backticks. Just the fix.
33
 
34
  ```
35
  Input: ModuleNotFoundError: No module named 'requests'
 
37
  ```
38
 
39
  ```
40
+ Input: PermissionError: [Errno 13] Permission denied: '/usr/local/bin/tool'
41
+ Output: sudo chmod +x /usr/local/bin/tool
42
+ ```
43
+
44
+ ```
45
+ Input: npm ERR! code EACCES
46
+ npm ERR! syscall mkdir
47
+ npm ERR! path /usr/local/lib/node_modules
48
+ Output: sudo npm install -g typescript
49
  ```
50
 
51
  ---
52
 
53
+ ## Benchmark Results (YOLO-Bench)
54
+
55
+ Evaluated on **218 verified CLI error examples** across 15 categories using structural match scoring (flag-order-independent, compound-command-aware).
56
+
57
+ | Mode | Structural Match |
58
+ |---|---|
59
+ | Raw LLM (no pipeline) | **59.2%** |
60
+ | Pipeline × 1 (interceptors + LLM) | **72.0%** |
61
+ | Pipeline × 3 (interceptors + memory + 3 LLM attempts) | **77.1%** |
62
+
63
+ **vs. baselines (raw LLM only):**
64
+
65
+ | Model | Structural Match |
66
+ |---|---|
67
+ | **YOLO-Coder-8B** | **59.2%** |
68
+ | YOLO-Coder-1.5B | 66.5% |
69
+ | GPT-4o | 48.6% |
70
+ | Claude Sonnet 4.6 | 60.1% |
71
+
72
+ > YOLO-Coder-8B pipeline×3 hits 77.1% — the highest of any model tested, including GPT-4o and Claude Sonnet.
73
+
74
+ Dataset and scoring code: [github.com/erdemozkan/YOLO-CODER/tree/main/benchmark](https://github.com/erdemozkan/YOLO-CODER/tree/main/benchmark)
75
+
76
+ ---
77
+
78
  ## Model Details
79
 
80
  | Property | Value |
 
84
  | LoRA rank | 8 |
85
  | LoRA scale | 20.0 |
86
  | Layers trained | 28 |
87
+ | Training iterations | 500 |
88
+ | Learning rate | 1e-5 |
89
+ | Batch size | 2 |
90
+ | Max sequence length | 2048 |
91
+ | Training hardware | Apple Silicon M-series |
92
+ | Training examples | 6,719 |
93
+ | Model size (GGUF Q4_K_M) | ~4.4GB |
94
+ | RAM required | ~6GB |
95
 
96
  ---
97
 
98
  ## Training Data
99
 
100
+ Trained on **6,719 CLI errorfix pairs** across 15 categories:
101
 
102
+ `Python` · `pip` · `Node.js` · `npm` · `TypeScript` · `Docker` · `Git` · `shell` · `Cargo/Rust` · `SSH` · `database` · `venv/conda` · `make/cmake` · `cloud (AWS/GCP)` · `yarn`
 
 
 
 
 
 
 
 
 
103
 
104
+ Format: ChatML with a system prompt enforcing single-command output. Each example is a real error a developer hit in a real terminal.
 
 
105
 
106
  ---
107
 
 
109
 
110
  | File | Description |
111
  |---|---|
112
+ | `YOLO-Coder-8B-Q4_K_M.gguf` | Q4_K_M quantized GGUF (~4.4GB) — recommended for Ollama |
 
113
  | `safetensors/` | fp16 HuggingFace safetensors — for further fine-tuning |
 
114
 
115
  ---
116
 
117
+ ## Quickstart with Ollama
118
 
119
  ```bash
120
+ # Pull and run directly
121
+ ollama run hf.co/erdemozkan/YOLO-Coder-8B
 
 
 
122
 
123
  # Test it
124
+ ollama run hf.co/erdemozkan/YOLO-Coder-8B "ModuleNotFoundError: No module named 'flask'"
125
  # → pip install flask
126
  ```
127
 
128
  ---
129
 
130
+ ## Usage with YOLO-CODER
131
 
132
  ```bash
133
+ pip install yolo-coder
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
+ # Use with the 8B model (default)
136
+ yoco python3 myapp.py
 
137
 
138
+ # Or explicitly
139
+ yoco --model hf.co/erdemozkan/YOLO-Coder-8B python3 myapp.py
 
 
 
 
 
 
 
 
140
  ```
141
 
142
+ YOLO-CODER adds the full pipeline on top: 91 deterministic interceptors fire first (<1ms), then fix memory, then the LLM as a last resort. This pushes the effective fix rate to 77.1%.
143
+
144
  ---
145
 
146
  ## Prompt Format (ChatML)
 
149
  <|im_start|>system
150
  You are a CLI repair tool. Output ONLY a single bare bash command to fix the error. No explanation. No markdown. No backticks.<|im_end|>
151
  <|im_start|>user
152
+ [Linux] $ python3 myapp.py
153
+ Error:
154
+ ModuleNotFoundError: No module named 'requests'
155
+ FIX:<|im_end|>
156
  <|im_start|>assistant
157
+ pip install requests<|im_end|>
158
  ```
159
 
160
  ---
161
 
162
+ ## 1.5B vs 8B
163
+
164
+ | | YOLO-Coder-1.5B | YOLO-Coder-8B |
165
+ |---|---|---|
166
+ | Size | ~941MB | ~4.4GB |
167
+ | RAM needed | ~2GB | ~6GB |
168
+ | Speed | <1s on Apple Silicon | 1–3s on Apple Silicon |
169
+ | Raw accuracy | 66.5% | 59.2% |
170
+ | Pipeline×3 accuracy | 71.1% | **77.1%** |
171
+ | Best for | Speed, low-RAM machines | Hard errors, best accuracy |
172
+
173
+ The 8B model gains the most on complex, multi-step, and rare errors where its larger context helps. The 1.5B is surprisingly strong on common errors and runs on almost anything.
174
+
175
+ ---
176
+
177
  ## Limitations
178
 
179
+ - Single-command output only — not suitable for multi-step fixes without a wrapper
180
+ - Complex or highly novel errors may fall through to suboptimal output
181
+ - Not a general coding assistant
182
 
183
  ---
184
 
185
  ## License
186
 
187
+ MIT