Mikrodev commited on
Commit
fc52946
Β·
verified Β·
1 Parent(s): afd094c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +62 -14
README.md CHANGED
@@ -35,14 +35,18 @@ stcoder-gemma4-12b is a Gemma-4-12B-it fine-tune that writes Mikrodev LogicStudi
35
 
36
  If you are choosing for the first time, start with [`Mikrodev/stcoder-qwen25-7b-gguf`](https://huggingface.co/Mikrodev/stcoder-qwen25-7b-gguf) at **Q8_0** instead (the fastest per answer of the four (5.8 s), 15/15 delivery, and the highest ChrF among the models that answered every prompt (38.5)). Come to this model for the reasons listed under *Is this the right model for you?*.
37
 
38
- > **This model cannot make tool calls.** It is a chat model: you describe a plant requirement, it
39
- > replies with Structured Text. Tool calling was trained and evaluated across this model line β€” the
40
- > Qwen3.5-9B family did learn it (tool-call composite 0.816 at Q8_0, falling to 0.642 at Q4_K_M),
41
- > while the code-focused families scored 0.02–0.06 and the Gemma family exactly 0.00. Because it was
42
- > not usable across the line it was **dropped as a product decision**, and these builds are published
43
- > and supported as chat models. Do not build an agent on them. Those tool-call figures come from a
44
- > separate internal evaluation that is not part of this release β€” not from the code study reported below, whose own
45
- > data and method ship with this model as the detailed report.
 
 
 
 
46
  >
47
  > **Always compile generated code in ALB / LogicStudio before deployment.** The model produces
48
  > dialect-correct code, which is not the same as correct control logic.
@@ -72,14 +76,14 @@ slower generation.
72
  |---|---|---|---|
73
  | `lora_adapter/` | The LoRA adapter this model was trained as β€” PEFT adapter on the base model above. Merge it yourself, stack it, or continue training from it. | small | being uploaded |
74
  | f16 merged weights | f16 is the merged fine-tune at full precision: the reference build, for evaluation or for producing your own quantisations. | 22.17 GiB | not shipped - rebuild from the adapter (snippet below) |
75
- | `Modelfile` | One ready-to-run Ollama definition: correct chat template, stop tokens, `num_ctx 8192` (the sequence length this model was trained at) and the system prompt. Its `FROM` points at the Q8_0 file; edit that one line if you downloaded a different quant. | small | in this repo |
76
  | `article_stcoder-gemma4-12b.html`, `article_stcoder-gemma4-12b.docx` | The full evaluation report for this model. | |
77
 
78
  ## Quick start with Ollama
79
 
80
- Requires **Ollama 0.5 or newer**.
81
 
82
- > Gemma turn template, not ChatML.
83
 
84
  **1. Install Ollama**
85
 
@@ -122,8 +126,36 @@ You get a body-only `iecst` block: `VAR` declarations plus logic, millisecond `I
122
  positional function-block calls, no `PROGRAM` wrapper. Paste it into ALB / LogicStudio and compile.
123
 
124
  For a different build, download that GGUF instead and change the Modelfile's `FROM` line to its
125
- filename (the Modelfile lists the alternatives at the top). With llama.cpp instead of Ollama, point `llama-cli -m <file>.gguf` at the
126
- GGUF and pass the same system prompt.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  ## Use the LoRA adapter directly
129
 
@@ -251,6 +283,10 @@ and limitations β€” ships in this repo:
251
  - Undecided readers, and anyone choosing on measured quality alone. Take the line's default, stcoder-qwen25-7b at Q6_K (5.82 GiB): in this head-to-head it leads on composite (0.844) and on ChrF at full delivery (38.5 over 15 of 15), and it is the fastest per answer at 5.8 s. If you want the one model that was 100% rule-clean in both conditions, take stcoder-qwen25-14b at Q4_K_M (8.37 GiB), accepting the lowest head-to-head ChrF (34.9) and the slowest generation per token (about 50 tok/s).
252
  - 8 GiB cards. Q4_K_M weights alone are 6.87 GiB, leaving no useful context budget; use stcoder-qwen25-7b at Q6_K (5.82 GiB) instead.
253
 
 
 
 
 
254
  ## Limitations of the evaluation
255
 
256
  - **Quantisation was not matched.** This fine-tune ran at Q6_K; the stock base ran at the
@@ -271,10 +307,22 @@ and limitations β€” ships in this repo:
271
 
272
  A curated in-house multi-task PLC corpus (approximately 2,930 training and 550 validation examples)
273
  focused on Structured Text generation, written against the ALB / Mikrodev LogicStudio rule set. The
274
- dataset is not publicly released. Sequence length 8192 tokens.
275
 
276
  Prompts are mostly English with a Turkish minority (10.8% of training prompts contain Turkish). Code, identifiers and code comments are always English; the model's conversational prose follows the language you write in.
277
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  ## Licence and attribution
279
 
280
  apache-2.0. Fine-tuned from [`google/gemma-4-12b-it`](https://huggingface.co/google/gemma-4-12b-it); the base
 
35
 
36
  If you are choosing for the first time, start with [`Mikrodev/stcoder-qwen25-7b-gguf`](https://huggingface.co/Mikrodev/stcoder-qwen25-7b-gguf) at **Q8_0** instead (the fastest per answer of the four (5.8 s), 15/15 delivery, and the highest ChrF among the models that answered every prompt (38.5)). Come to this model for the reasons listed under *Is this the right model for you?*.
37
 
38
+ | At a glance | |
39
+ |---|---|
40
+ | Take this build | **Q8_0** β€” `gemma4_12b-tc.q8_0.gguf`, 11.80 GiB, wants 13.8 GiB free |
41
+ | Dialect-clean replies | **86.7%** against 6.7% for the stock base |
42
+ | Speed | 8.5s per reply, 401 output tokens (median 360) |
43
+ | Runs on | Ollama 0.32+ (tested on 0.32.5), llama.cpp β€” CPU, GPU or Apple unified memory |
44
+ | Trained for | Mikrodev / ALB Structured Text only β€” body-only, no POU wrappers, INT milliseconds |
45
+
46
+ > **Tool calling is not supported on this release.** These are chat models: you describe a plant
47
+ > requirement, they reply with Structured Text. It was trained, measured and then dropped as a
48
+ > product decision β€” the numbers and the reasoning are under *Not the right tool for*. Do not build
49
+ > an agent on them.
50
  >
51
  > **Always compile generated code in ALB / LogicStudio before deployment.** The model produces
52
  > dialect-correct code, which is not the same as correct control logic.
 
76
  |---|---|---|---|
77
  | `lora_adapter/` | The LoRA adapter this model was trained as β€” PEFT adapter on the base model above. Merge it yourself, stack it, or continue training from it. | small | being uploaded |
78
  | f16 merged weights | f16 is the merged fine-tune at full precision: the reference build, for evaluation or for producing your own quantisations. | 22.17 GiB | not shipped - rebuild from the adapter (snippet below) |
79
+ | `Modelfile` | One ready-to-run Ollama definition: the system prompt, the sampling defaults and `num_ctx 8192` (the sequence length this model was trained at). It deliberately carries **no chat template** β€” Ollama uses its built-in `gemma4` renderer, which matches the chat template stored inside the GGUF, so the chat format is the trained one and cannot drift out of sync with this file. Its `FROM` points at the Q8_0 file; edit that one line if you downloaded a different quant. | small | in this repo |
80
  | `article_stcoder-gemma4-12b.html`, `article_stcoder-gemma4-12b.docx` | The full evaluation report for this model. | |
81
 
82
  ## Quick start with Ollama
83
 
84
+ Requires **Ollama 0.32 or newer**.
85
 
86
+ > Gemma 4 support in Ollama is recent - an older build cannot load this architecture at all. Verified on 0.32.5, where Ollama formats the chat with its built-in `gemma4` renderer.
87
 
88
  **1. Install Ollama**
89
 
 
126
  positional function-block calls, no `PROGRAM` wrapper. Paste it into ALB / LogicStudio and compile.
127
 
128
  For a different build, download that GGUF instead and change the Modelfile's `FROM` line to its
129
+ filename (the Modelfile lists the alternatives at the top).
130
+
131
+ With llama.cpp instead of Ollama, run `llama-cli -m <file>.gguf --jinja` and pass the same system
132
+ prompt. **`--jinja` matters:** it makes llama.cpp use the chat template stored inside the GGUF β€” the
133
+ one this model was trained with β€” instead of guessing a format.
134
+
135
+ ## What the fine-tune actually changes
136
+
137
+ One prompt from the study below, sent to the stock base and to this fine-tune under the same short
138
+ system prompt that lists **no** dialect rules:
139
+
140
+ > *We've got a conveyor with a pre-start warning horn. When the operator hits the start button I need the horn to sound for 5 seconds first, then the motor kicks in and the horn goes quiet.*
141
+
142
+ The stock base answered with named function-block parameters and a TIME literal β€” constructs the Mikrodev runtime rejects:
143
+
144
+ ```iecst
145
+ t_WarningTimer(IN := x_SystemActive, PT := T#5s);
146
+ ```
147
+
148
+ This fine-tune, same prompt, no rules in the prompt:
149
+
150
+ ```iecst
151
+ tPreStart(TRUE, 5000);
152
+ ```
153
+
154
+ Positional function-block call, delay as an `INT` in milliseconds, no wrapper β€” the dialect came out
155
+ of the weights, not out of the prompt. Both snippets are verbatim from the recorded run.
156
+
157
+ > These lines show **dialect**, not correctness. R24 certifies that no forbidden construct appears;
158
+ > it does not check that the logic works. Read *Weaknesses* before you trust an answer.
159
 
160
  ## Use the LoRA adapter directly
161
 
 
283
  - Undecided readers, and anyone choosing on measured quality alone. Take the line's default, stcoder-qwen25-7b at Q6_K (5.82 GiB): in this head-to-head it leads on composite (0.844) and on ChrF at full delivery (38.5 over 15 of 15), and it is the fastest per answer at 5.8 s. If you want the one model that was 100% rule-clean in both conditions, take stcoder-qwen25-14b at Q4_K_M (8.37 GiB), accepting the lowest head-to-head ChrF (34.9) and the slowest generation per token (about 50 tok/s).
284
  - 8 GiB cards. Q4_K_M weights alone are 6.87 GiB, leaving no useful context budget; use stcoder-qwen25-7b at Q6_K (5.82 GiB) instead.
285
 
286
+ Those tool-call figures come from a separate internal evaluation that is not part of this release β€”
287
+ not from the code study reported above, whose own data and method ship with this model as the
288
+ detailed report.
289
+
290
  ## Limitations of the evaluation
291
 
292
  - **Quantisation was not matched.** This fine-tune ran at Q6_K; the stock base ran at the
 
307
 
308
  A curated in-house multi-task PLC corpus (approximately 2,930 training and 550 validation examples)
309
  focused on Structured Text generation, written against the ALB / Mikrodev LogicStudio rule set. The
310
+ dataset is not publicly released.
311
 
312
  Prompts are mostly English with a Turkish minority (10.8% of training prompts contain Turkish). Code, identifiers and code comments are always English; the model's conversational prose follows the language you write in.
313
 
314
+ | Training setting | Value |
315
+ |---|---|
316
+ | Method | LoRA (PEFT) supervised fine-tune |
317
+ | LoRA rank / alpha | 32 / 32 (dropout 0.0) |
318
+ | Epochs | 3 |
319
+ | Learning rate | 0.0002 |
320
+ | Sequence length | 8192 tokens |
321
+ | Effective batch | 8 (batch 1 x grad-accum 8) |
322
+
323
+ The published LoRA adapter is exactly this run's output, so anything above can be reproduced or
324
+ continued from it.
325
+
326
  ## Licence and attribution
327
 
328
  apache-2.0. Fine-tuned from [`google/gemma-4-12b-it`](https://huggingface.co/google/gemma-4-12b-it); the base