Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- code-generation
|
| 7 |
+
- documentation
|
| 8 |
+
- text-to-code
|
| 9 |
+
- rust
|
| 10 |
+
- python
|
| 11 |
+
- javascript
|
| 12 |
+
- sparse-transformer
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
inference: false
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Cofos Code Model (v1-logic)
|
| 18 |
+
|
| 19 |
+
**Cofos** is a logic- and coding-oriented decoder-only language model built on AMEFORGE's **SparseMind** architecture.
|
| 20 |
+
It is specialized for code generation, docstring construction, and code explanation in Python, JavaScript, and Rust.
|
| 21 |
+
|
| 22 |
+
Developed by **AMEFORGE**.
|
| 23 |
+
|
| 24 |
+
## Architecture & Parameters
|
| 25 |
+
- **Architecture:** SparseMind v15 (dynamic neural type management, sparse attention, and sparse FFN)
|
| 26 |
+
- **Parameters:** 12,793,477
|
| 27 |
+
- **Hidden dimension:** 256
|
| 28 |
+
- **Layers:** 6
|
| 29 |
+
- **Context length:** 384 tokens
|
| 30 |
+
- **Tokenizer:** Custom BPE Tokenizer (vocab size 8192) with atomic indents/operators/keywords
|
| 31 |
+
|
| 32 |
+
## Training Details
|
| 33 |
+
- Trained on **30,000,000+** procedurally generated programming templates on-the-fly.
|
| 34 |
+
- Masked loss to learn code completion and documentation formatting.
|
| 35 |
+
- Best Python syntax-validity on held-out validation: 79.7%
|
| 36 |
+
|
| 37 |
+
## How to use
|
| 38 |
+
```python
|
| 39 |
+
import torch
|
| 40 |
+
import sentencepiece as spm
|
| 41 |
+
|
| 42 |
+
# Load checkpoint
|
| 43 |
+
ckpt = torch.load("cofos_best.pt", map_location="cpu")
|
| 44 |
+
cfg_dict = ckpt["config"]
|
| 45 |
+
|
| 46 |
+
# Instantiate model architecture
|
| 47 |
+
# model = SparseMind(Config(**cfg_dict))
|
| 48 |
+
# model.load_state_dict(ckpt["model"])
|
| 49 |
+
# model.eval()
|
| 50 |
+
```
|