coronerai commited on
Commit
d26ca0e
·
verified ·
1 Parent(s): b02c860

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +40 -13
README.md CHANGED
@@ -1,21 +1,48 @@
1
  ---
2
- base_model: unsloth/Qwen2.5-Coder-7B-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:** coronerai
16
- - **License:** apache-2.0
17
- - **Finetuned from model :** unsloth/Qwen2.5-Coder-7B-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
  license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-Coder-7B-Instruct
4
+ library_name: transformers
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - solidity
8
+ - smart-contracts
9
+ - token-risk
10
+ - lora
11
  language:
12
+ - en
13
  ---
14
 
15
+ ![Coroner: every token dies. We write the report.](https://raw.githubusercontent.com/coroner-hash/ai/main/release/banner.png)
16
+
17
+ # Coroner Coder 7B
18
+
19
+ A small model that fixes the patterns the Coroner scanner flags in an ERC-20 token contract: it takes a Solidity source plus the scanner's flags and returns a corrected contract and a short list of changes.
20
+
21
+ > Always compile and review the result yourself. A patch that compiles is not an audit. Not financial or security advice.
22
+
23
+ ## What it fixes
24
+ The same patterns the Coroner pre-mortem scanner reports from source code:
25
+ `mint_with_live_owner`, `blacklist_function`, `pause_function`, `tax_changeable`, `risky_opcode` (selfdestruct, delegatecall, tx.origin) and `owner_privileges`.
26
+
27
+ ## Training
28
+ - Base: Qwen2.5-Coder-7B-Instruct (Apache 2.0). Method: LoRA (rank 16) on 4-bit weights, one epoch (88 steps), then merged to 16-bit.
29
+ - Data: 1,400 synthetic examples. Each is a flawed token contract with its fix, generated from templates in two source layouts. **Every target is verified**: the corrected contract compiles with solc 0.8.24, keeps the ERC-20 interface and clears the flagged patterns. Generator and verifier: https://github.com/coroner-hash/ai/tree/main/coder
30
+
31
+ ## Evaluation
32
+ A fix counts only if the patched contract compiles, keeps the ERC-20 interface, clears every flag and adds none. 40 held-out contracts in a third source layout the model never saw in training (greedy decoding):
33
+
34
+ | | Base model | Coroner Coder |
35
+ |---|---|---|
36
+ | Compiles | 1.00 | 0.925 |
37
+ | Flags cleared | 0.125 | 0.925 |
38
+ | Full fix (all checks) | 0.125 | 0.925 |
39
 
40
+ Returning the contract unchanged scores 0.05. In the layouts it was trained on the model scores 1.00, which mostly shows it learned the templates.
 
 
41
 
42
+ ## Limits
43
+ - **Synthetic, narrow data.** All contracts are single-file ERC-20 variants without imports. Real contracts from a market will be messier; expect lower numbers. This is a first version.
44
+ - About 1 in 13 outputs did not compile in the held-out test. Always compile.
45
+ - It removes risky features; it does not find new bugs, and it can change behaviour. Review the diff.
46
+ - Only the scanner's six patterns. Not a general Solidity auditor.
47
 
48
+ Source, data generator and scorer: https://github.com/coroner-hash/ai