chaojixiaokeai commited on
Commit
a726c0f
·
verified ·
1 Parent(s): 1fdc2a8

Upload PROJECT_README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. PROJECT_README.md +116 -0
PROJECT_README.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CortexNet
2
+
3
+ [![CI](https://github.com/chaojixiaokeai/CortexNet/actions/workflows/ci.yml/badge.svg)](https://github.com/chaojixiaokeai/CortexNet/actions/workflows/ci.yml)
4
+ [![PyPI version](https://img.shields.io/pypi/v/cortexnet.svg)](https://pypi.org/project/cortexnet/)
5
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
6
+
7
+ ## Language / 语言
8
+
9
+ - 中文文档入口: `docs/README.md`(Chinese + English full docs index)
10
+ - English quick docs: `docs/en/QUICKSTART_AND_USAGE.md`
11
+ - Chinese quick docs: `docs/zh-CN/QUICKSTART_AND_USAGE.md`
12
+
13
+ `CortexNet` 是一个面向语言建模与推理场景的神经网络架构实现,核心思路是将多尺度状态空间建模、选择性稀疏注意力、记忆系统、条件路由与可选高级推理模块组合到同一框架中。
14
+
15
+ `CortexNet` is a unified neural architecture implementation for language modeling and reasoning, combining multi-scale SSM, selective sparse attention, memory, conditional routing, and optional advanced reasoning modules in one framework.
16
+
17
+ 本仓库已经完成以下整理:
18
+
19
+ - 统一对外主模型命名为 `CortexNet`(不再以 `*V3` 作为主入口)
20
+ - 代码按 `pip` 可发布标准重构到 `cortexnet/` 包目录
21
+ - 基准/聊天/评测脚本统一归档到 `scripts/`
22
+ - 清理无用导入、冗余变量和缓存文件
23
+ - 补充架构文档和模块映射文档,方便开源协作
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install -e .
29
+ ```
30
+
31
+ 或构建并安装 wheel:
32
+
33
+ ```bash
34
+ python -m pip install build
35
+ python -m build
36
+ pip install dist/*.whl
37
+ ```
38
+
39
+ ## CLI
40
+
41
+ ```bash
42
+ python -m cortexnet --version
43
+ python -m cortexnet --smoke-test
44
+ ```
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ import torch
50
+ from cortexnet import CortexNet, CortexNetConfig
51
+
52
+ config = CortexNetConfig(
53
+ vocab_size=32000,
54
+ hidden_size=512,
55
+ num_layers=4,
56
+ num_heads=8,
57
+ max_seq_len=2048,
58
+ )
59
+
60
+ model = CortexNet(config).eval()
61
+ input_ids = torch.randint(0, config.vocab_size, (1, 16))
62
+
63
+ with torch.no_grad():
64
+ out = model(input_ids)
65
+ print(out["logits"].shape)
66
+ ```
67
+
68
+ ## Package Layout
69
+
70
+ ```text
71
+ cortexnet/
72
+ adapter/ # 开源模型识别、权重映射、架构适配、推理适配、校准
73
+ ops/ # 设备与算子抽象(CPU/CUDA/MPS/NPU/MLU)
74
+ model.py # 主模型与 from_pretrained
75
+ blocks.py # 核心 block 组合
76
+ ...
77
+ scripts/
78
+ benchmarks/ # 性能与量化基准
79
+ chat/ # 聊天脚本
80
+ eval/ # 能力评测脚本
81
+ dev/ # 一键流程与测试运行器
82
+ tests/ # 回归与单元测试
83
+ ```
84
+
85
+ ## Test
86
+
87
+ ```bash
88
+ python -m pytest -q
89
+ ```
90
+
91
+ ## Docs
92
+
93
+ - 文档中心(中英文完整文档):`docs/README.md`
94
+ - 架构说明:`ARCHITECTURE.md`
95
+ - 模块职责图:`MODULE_MAP.md`
96
+ - 变更记录:`CHANGELOG.md`
97
+ - 贡献指南:`CONTRIBUTING.md`
98
+ - 支持与问题分流:`SUPPORT.md`
99
+ - 安全策略:`SECURITY.md`
100
+ - 示例代码:`examples/README.md`
101
+ - 发布基准报告:`docs/reports/README.md`
102
+ - Hugging Face 发布:`docs/en/HF_PUBLISHING.md` / `docs/zh-CN/HF_PUBLISHING.md`
103
+
104
+ ## Compatibility Notes
105
+
106
+ - 对外推荐只使用 `CortexNet`。
107
+ - 历史命名(如 `CortexNetV2` / `CortexNetV3`)仍保留为兼容别名,避免旧代码立即失效。
108
+
109
+ ## Development Commands
110
+
111
+ ```bash
112
+ make install-dev
113
+ make lint
114
+ make test-all
115
+ make check
116
+ ```