77
88__all__ = ["DOC_PATH" , "check_document" , "render_blocks" , "update_document" ]
99
10+ import re
1011from collections import Counter
1112from pathlib import Path
12- import re
1313
1414from mobius .integrations .gguf ._arch_registry import iter_arch_specs
1515from mobius .integrations .gguf ._mmproj_registry import iter_projector_specs
@@ -61,9 +61,7 @@ def _summary() -> str:
6161 qtypes = iter_quant_specs ()
6262 projectors = iter_projector_specs ()
6363 tokenizers = tokenizer_pre_policies ()
64- stored = [
65- spec for spec in qtypes if spec .readable and spec .role is StorageRole .QUANTIZED
66- ]
64+ stored = [spec for spec in qtypes if spec .readable and spec .role is StorageRole .QUANTIZED ]
6765 routed = [
6866 spec
6967 for spec in stored
@@ -73,49 +71,59 @@ def _summary() -> str:
7371 ]
7472 graph_counts = Counter (spec .graph .value for spec in architectures )
7573 runtime_counts = Counter (spec .runtime .value for spec in architectures )
76- quantized_import_counts = Counter (
77- spec .quantized_import .value for spec in architectures
78- )
74+ quantized_import_counts = Counter (spec .quantized_import .value for spec in architectures )
7975 projector_counts = {
8076 "graph-importable" : sum (spec .is_importable for spec in projectors ),
8177 "runtime-supported" : sum (spec .runtime is Support .SUPPORTED for spec in projectors ),
8278 }
8379 return "\n " .join (
8480 (
85- f"**Pinned source:** `ggml-org/llama.cpp@{ UPSTREAM_COMMIT } ` "
86- f"({ UPSTREAM_DATE } )." ,
81+ f"**Pinned source:** `ggml-org/llama.cpp@{ UPSTREAM_COMMIT } ` ({ UPSTREAM_DATE } )." ,
8782 "" ,
8883 "| Census | Total | Closure |" ,
8984 "|---|---:|---|" ,
90- f"| Architectures | { len (architectures )} | "
91- f"graph verdicts: { dict (sorted (graph_counts .items ()))} ; "
92- f"importable: { sum (spec .is_importable for spec in architectures )} ; "
93- f"quantized import: { dict (sorted (quantized_import_counts .items ()))} ; "
94- f"runtime: { dict (sorted (runtime_counts .items ()))} |" ,
95- f"| Active stored qtypes | { len (stored )} | { len (routed )} have an import route; "
96- f"{ len (stored ) - len (routed )} are explicitly deferred with no route |" ,
97- f"| Serialized projector strings | { len (projectors )} | "
98- f"{ dict (sorted (projector_counts .items ()))} |" ,
99- f"| Tokenizer pre identifiers | { len (tokenizers )} | "
100- f"{ len ({policy .canonical for policy in tokenizers .values ()})} semantic groups; "
101- "all default to deferred and become exact-copy only with a validated embedded "
102- "`tokenizer.huggingface.json` |" ,
85+ (
86+ f"| Architectures | { len (architectures )} | "
87+ f"graph verdicts: { dict (sorted (graph_counts .items ()))} ; "
88+ f"importable: { sum (spec .is_importable for spec in architectures )} ; "
89+ f"quantized import: { dict (sorted (quantized_import_counts .items ()))} ; "
90+ f"runtime: { dict (sorted (runtime_counts .items ()))} |"
91+ ),
92+ (
93+ f"| Active stored qtypes | { len (stored )} | { len (routed )} have an import route; "
94+ f"{ len (stored ) - len (routed )} are explicitly deferred with no route |"
95+ ),
96+ (
97+ f"| Serialized projector strings | { len (projectors )} | "
98+ f"{ dict (sorted (projector_counts .items ()))} |"
99+ ),
100+ (
101+ f"| Tokenizer pre identifiers | { len (tokenizers )} | "
102+ f"{ len ({policy .canonical for policy in tokenizers .values ()})} semantic groups; "
103+ "all default to deferred and become exact-copy only with a validated embedded "
104+ "`tokenizer.huggingface.json` |"
105+ ),
103106 "" ,
104- "`SUPPORTED` means the named capability is implemented and mechanically tested. "
105- "`DEFERRED` means it is intentionally unavailable pending the stated work. "
106- "`REJECTED` means the input or route is invalid by policy. Graph support proves "
107- "construction/execution only; runtime support additionally requires a pinned real "
108- "artifact, independent parity, and deterministic generation or stateful semantics. "
109- "Tokenizer `copy` delegates algorithm semantics to an embedded, vocabulary-identical "
110- "tokenizer JSON; it is not a reconstructed or independently proven tokenizer." ,
107+ (
108+ "`SUPPORTED` means the named capability is implemented and mechanically tested. "
109+ "`DEFERRED` means it is intentionally unavailable pending the stated work. "
110+ "`REJECTED` means the input or route is invalid by policy. Graph support proves "
111+ "construction/execution only; runtime support additionally requires a pinned real "
112+ "artifact, independent parity, and deterministic generation or stateful semantics. "
113+ "Tokenizer `copy` delegates algorithm semantics to an embedded, "
114+ "vocabulary-identical tokenizer JSON; it is not a reconstructed or independently "
115+ "proven tokenizer."
116+ ),
111117 )
112118 )
113119
114120
115121def _architectures () -> str :
116122 rows = [
117- "| Canonical architecture | Aliases | Import route | Tensor exactness | "
118- "Config/tensor/graph/runtime/quantized import | Restriction or evidence gap |" ,
123+ (
124+ "| Canonical architecture | Aliases | Import route | Tensor exactness | "
125+ "Config/tensor/graph/runtime/quantized import | Restriction or evidence gap |"
126+ ),
119127 "|---|---|---|---|---|---|" ,
120128 ]
121129 upstream = upstream_architectures ()
@@ -155,8 +163,10 @@ def _qtypes() -> str:
155163
156164def _projectors () -> str :
157165 rows = [
158- "| Projector string | Modality | Paired text architecture | "
159- "Metadata/tensor/graph/runtime | Exactness/evidence |" ,
166+ (
167+ "| Projector string | Modality | Paired text architecture | "
168+ "Metadata/tensor/graph/runtime | Exactness/evidence |"
169+ ),
160170 "|---|---|---|---|---|" ,
161171 ]
162172 for spec in sorted (iter_projector_specs (), key = lambda item : item .projector_type ):
@@ -180,16 +190,19 @@ def _projectors() -> str:
180190
181191def _tokenizers () -> str :
182192 rows = [
183- "| Exact identifier | Canonical semantic group | Pinned pre-type | Default route | "
184- "Exactness/restriction |" ,
193+ (
194+ "| Exact identifier | Canonical semantic group | Pinned pre-type | Default route | "
195+ "Exactness/restriction |"
196+ ),
185197 "|---|---|---|---|---|" ,
186198 ]
187199 for identifier , policy in sorted (tokenizer_pre_policies ().items ()):
188- rows . append (
200+ row = (
189201 f"| `{ identifier } ` | `{ policy .canonical } ` | `{ policy .pre_type } ` | "
190202 f"`{ policy .default_route } ` | Exact-copy only after embedded tokenizer JSON and "
191203 "ordered vocabulary validation; otherwise runtime packaging is deferred. |"
192204 )
205+ rows .append (row )
193206 return "\n " .join (rows )
194207
195208
@@ -206,7 +219,9 @@ def render_blocks() -> dict[str, str]:
206219
207220def _replace (text : str , begin : str , end : str , body : str ) -> str :
208221 if text .count (begin ) != 1 or text .count (end ) != 1 :
209- raise ValueError (f"Expected exactly one generated block delimited by { begin !r} /{ end !r} " )
222+ raise ValueError (
223+ f"Expected exactly one generated block delimited by { begin !r} /{ end !r} "
224+ )
210225 before , remainder = text .split (begin , 1 )
211226 _ , after = remainder .split (end , 1 )
212227 return f"{ before } { begin } \n \n { body } \n \n { end } { after } "
0 commit comments