Rohanify commited on
Commit
ba4ef5e
·
verified ·
1 Parent(s): 4a42dfa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +173 -0
README.md CHANGED
@@ -1,3 +1,176 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - code
7
+ - python
8
+ - text-generation
9
+ - gpt2
10
+ - from-scratch
11
+ - small-model
12
+ - code-generation
13
+ pipeline_tag: text-generation
14
+
15
  ---
16
+ # PyBlissa-Coder-40M
17
+ # !! 14.6% SCORE ON HumanEval PASS@1 !!
18
+ ---
19
+
20
+ PyBlissa-Coder-40M is the second model from the PyBlissa-Coder family that mainly supports python coding.
21
+ Despite its small footprint, 40M parameters, trained on 272M tokens, PyBlissa has achieved an amazing score of 14.6%
22
+ on the HumanEval dataset; and 4.4% on MBPP dataset (both being benchmark datasets).
23
+ While scoring such a good number, it's imperfections are also something to be aware of.
24
+ This model can sometimes generate wrong, inefficient, or broken codes. Though its mostly temperature-dependent.
25
+
26
+
27
+ <p align="center">
28
+ <img src="pyblissa_banner.png" alt="PyBlissa-Coder-40M" width="100%">
29
+ </p>
30
+
31
+ <p align="center">
32
+ <img src="pyblissa_loss_curve.png" alt="Training curve" width="100%">
33
+ </p>
34
+
35
+
36
+ ## Benchmarks
37
+
38
+ | Benchmark | Score | Protocol | Temp |
39
+ |-----------|-------|----------|------|
40
+ | HumanEval pass@1 | **14.6%** (24/164) | zero-shot, fenced-code extraction | 0.25 |
41
+ | MBPP pass@1 | **4.4%** (22/500) | official tests-in-prompt (Austin et al. 2021) | 0.05 |
42
+
43
+ ### How PyBlissa compares on HumanEval
44
+
45
+ | Model | Params | HumanEval pass@1 |
46
+ |-------|--------|------------------|
47
+ | GPT-Neo | 125M | 0.75% |
48
+ | CodeParrot-small | 110M | 3.80% |
49
+ | PyCodeGPT | 110M | 8.33% |
50
+ | **PyBlissa-Coder** | **40M** | **14.6%** |
51
+
52
+ > PyBlissa is ~2.75× smaller than CodeParrot-small yet scores roughly 4× higher
53
+ > on HumanEval pass@1, trained on a single consumer GPU.
54
+ ---
55
+
56
+ ## Model details
57
+
58
+ | | |
59
+ |---|---|
60
+ | Architecture | Decoder-only transformer (GPT-2 style, nanoGPT lineage) |
61
+ | Parameters | 39.9M |
62
+ | Layers | 10 |
63
+ | Model dim (d_model) | 512 |
64
+ | Heads | 8 (head_dim 64) |
65
+ | FFN dim (d_ff) | 2048 |
66
+ | Context length | 512 tokens |
67
+ | Vocab size | 16,000 (custom ByteLevel BPE) |
68
+ | Tied embeddings | Yes |
69
+ | Precision | trained in bf16, released as F32 GGUF |
70
+ | Best val loss | 0.3615 |
71
+
72
+ ### Training
73
+
74
+ | | |
75
+ |---|---|
76
+ | Hardware | 1 × NVIDIA RTX 5080 (16 GB) |
77
+ | Training tokens | 272M (train split) |
78
+ | Epochs | 5 |
79
+ | Optimizer | AdamW (β 0.9/0.95, wd 0.1) |
80
+ | LR schedule | cosine, 4e-4 → 4e-5, ~2% warmup |
81
+ | Batch size | 48 |
82
+ | Total steps | 55,405 |
83
+ | Wall-clock time | ~116 min |
84
+
85
+ ---
86
+
87
+ ## Usage
88
+
89
+ ### Ollama
90
+
91
+ ```bash
92
+ ollama run hf.co/Rohanify/PyBlissa-Coder-40M:F32
93
+ ```
94
+
95
+ The repo ships `template` and `params` files, so Ollama applies the correct
96
+ `PROMPT:`/`CODE:` format and sampling defaults automatically — no Modelfile
97
+ needed for remote runs.
98
+
99
+ To run a local GGUF instead:
100
+
101
+ ```bash
102
+ ollama create pyblissa-40m -f Modelfile
103
+ ollama run pyblissa-40m "write a function that checks if a number is prime"
104
+ ```
105
+
106
+ ### Prompt format
107
+
108
+ The model was trained on a plain-text wrapper. At inference, the prompt is
109
+ wrapped as:
110
+
111
+ ```
112
+ PROMPT: {your instruction}
113
+ CODE:
114
+ ```
115
+
116
+ The model then emits a fenced ```python code block. (When using Ollama, the
117
+ `template` file does this wrapping for you — just type a plain instruction.)
118
+
119
+ ### Recommended sampling
120
+
121
+ | Parameter | Value |
122
+ |-----------|-------|
123
+ | temperature | 0.25 – 0.3 |
124
+ | top_k | 10 |
125
+ | repeat_penalty | 1.25 |
126
+ | num_ctx | 512 |
127
+
128
+ ---
129
+
130
+ ## Limitations
131
+
132
+ PyBlissa is a 40M-parameter model trained primarily for **prompt → Python
133
+ generation**. Known limitations:
134
+
135
+ - It is a small model: it solves short, self-contained functions well but
136
+ struggles with multi-step or library-heavy tasks.
137
+ - It sometimes omits `import` statements for stdlib modules it uses
138
+ (`math`, `re`, `hashlib`, etc.).
139
+ - It can occasionally emit a short natural-language preamble before the code
140
+ block on harder prompts.
141
+ - Code explanation and non-Python tasks are out of distribution — it may
142
+ attempt them, but that is not what it was trained for.
143
+ - As with any code model, **review and test generated code before running it.**
144
+
145
+ ---
146
+
147
+ ## Training data & attribution
148
+
149
+ This model was trained on the following datasets. Per their licenses,
150
+ attribution is provided here:
151
+
152
+ - **nvidia/OpenCodeInstruct** — CC-BY-4.0
153
+ https://huggingface.co/datasets/nvidia/OpenCodeInstruct
154
+ - **flytech/python-codes-25k** — MIT
155
+ https://huggingface.co/datasets/flytech/python-codes-25k
156
+
157
+ No OpenAI-derived data was used in training.
158
+
159
+ ---
160
+
161
+ ## License
162
+
163
+ The model weights are released under **Apache-2.0**. Note that the training
164
+ data carries its own licenses (CC-BY-4.0 and MIT, see above), which require
165
+ attribution as provided.
166
+
167
+ ---
168
+
169
+ ```bibtex
170
+ @misc{pyblissa2026,
171
+ title = {PyBlissa-Coder-40M: A from-scratch Python code model},
172
+ author = {Rohan},
173
+ year = {2026},
174
+ howpublished = {\url{https://huggingface.co/Rohanify/PyBlissa-Coder-40M}}
175
+ }
176
+ ```