@@ -903,6 +903,7 @@ def copy_demos(_app: Optional[Any] = None):
903903 <select id="btArch"><option value="">All Architectures</option></select>
904904 <select id="btPrefix"><option value="">All Organizations</option></select>
905905 <select id="btStatus"><option value="">All Statuses</option><option value="1">Verified</option><option value="0">Unverified</option><option value="3">Failed</option></select>
906+ <label class="bt-canonical-toggle"><input type="checkbox" id="btCanonical"> Canonical only</label>
906907 <span class="bt-count" id="btCount"></span>
907908 </div>
908909 <div class="bt-wrap">
@@ -928,55 +929,8 @@ def copy_demos(_app: Optional[Any] = None):
928929(function() {
929930 const PS = 25, COLS = 9;
930931 const SM = {0:'Unverified',1:'Verified',2:'Unverified',3:'Failed'};
931- // Canonical org per supported architecture. Pinned to top of the Organizations filter.
932- const OFFICIAL_ORGS = {
933- ApertusForCausalLM: ['swiss-ai'],
934- BloomForCausalLM: ['bigscience'],
935- CodeGenForCausalLM: ['Salesforce'],
936- CohereForCausalLM: ['CohereLabs'],
937- DeepseekV3ForCausalLM: ['deepseek-ai'],
938- FalconForCausalLM: ['tiiuae'],
939- GPT2LMHeadModel: ['openai-community'],
940- GPTBigCodeForCausalLM: ['bigcode'],
941- GPTJForCausalLM: ['EleutherAI'],
942- GPTNeoForCausalLM: ['EleutherAI'],
943- GPTNeoXForCausalLM: ['EleutherAI'],
944- Gemma2ForCausalLM: ['google'],
945- Gemma3ForCausalLM: ['google'],
946- Gemma3ForConditionalGeneration: ['google'],
947- GemmaForCausalLM: ['google'],
948- GptOssForCausalLM: ['openai'],
949- GraniteForCausalLM: ['ibm-granite'],
950- GraniteMoeForCausalLM: ['ibm-granite'],
951- GraniteMoeHybridForCausalLM: ['ibm-granite'],
952- HubertForCTC: ['facebook'],
953- HubertModel: ['facebook'],
954- InternLM2ForCausalLM: ['internlm'],
955- LlamaForCausalLM: ['meta-llama'],
956- LlavaForConditionalGeneration: ['llava-hf'],
957- LlavaNextForConditionalGeneration: ['llava-hf'],
958- LlavaOnevisionForConditionalGeneration: ['llava-hf'],
959- MPTForCausalLM: ['mosaicml'],
960- Mamba2ForCausalLM: ['state-spaces'],
961- MambaForCausalLM: ['state-spaces'],
962- MistralForCausalLM: ['mistralai'],
963- MixtralForCausalLM: ['mistralai'],
964- OPTForCausalLM: ['facebook'],
965- Olmo2ForCausalLM: ['allenai'],
966- Olmo3ForCausalLM: ['allenai'],
967- OlmoForCausalLM: ['allenai'],
968- OlmoeForCausalLM: ['allenai'],
969- OpenELMForCausalLM: ['apple'],
970- Phi3ForCausalLM: ['microsoft'],
971- PhiForCausalLM: ['microsoft'],
972- Qwen2ForCausalLM: ['Qwen'],
973- Qwen3ForCausalLM: ['Qwen'],
974- Qwen3MoeForCausalLM: ['Qwen'],
975- Qwen3NextForCausalLM: ['Qwen'],
976- Qwen3_5ForCausalLM: ['Qwen'],
977- StableLmForCausalLM: ['stabilityai'],
978- XGLMForCausalLM: ['facebook'],
979- };
932+ // Interpolated from CANONICAL_AUTHORS_BY_ARCH (Python, registry __init__).
933+ const OFFICIAL_ORGS = __OFFICIAL_ORGS_JSON__;
980934 const cfgCache = {};
981935 let all=[], filt=[], pg=1, dt=null, sortCol='', sortDir='asc';
982936
@@ -1367,6 +1321,7 @@ def copy_demos(_app: Optional[Any] = None):
13671321 if (up.get('arch')) document.getElementById('btArch').value = up.get('arch');
13681322 if (up.get('org')) { populatePrefixFilter(); document.getElementById('btPrefix').value = up.get('org'); }
13691323 if (up.has('status')) document.getElementById('btStatus').value = up.get('status');
1324+ if (up.get('canonical') === '1') document.getElementById('btCanonical').checked = true;
13701325 if (up.get('sort')) { sortCol = up.get('sort'); sortDir = up.get('dir') || 'asc'; updateSortHeaders(); }
13711326 apply();
13721327 } catch(e) {
@@ -1380,11 +1335,16 @@ def copy_demos(_app: Optional[Any] = None):
13801335 const a = document.getElementById('btArch').value;
13811336 const pf = document.getElementById('btPrefix').value;
13821337 const sv = document.getElementById('btStatus').value;
1338+ const canonOnly = document.getElementById('btCanonical').checked;
13831339 filt = all.filter(m => {
13841340 if (s && !m.model_id.toLowerCase().includes(s)) return false;
13851341 if (a && m.architecture_id !== a) return false;
13861342 if (pf && getPrefix(m.model_id) !== pf) return false;
13871343 if (sv !== '' && m.status !== +sv) return false;
1344+ if (canonOnly) {
1345+ const orgs = OFFICIAL_ORGS[m.architecture_id];
1346+ if (!orgs || !orgs.includes(getPrefix(m.model_id))) return false;
1347+ }
13881348 return true;
13891349 });
13901350 sortFilt();
@@ -1434,10 +1394,12 @@ def copy_demos(_app: Optional[Any] = None):
14341394 const a = document.getElementById('btArch').value;
14351395 const pf = document.getElementById('btPrefix').value;
14361396 const sv = document.getElementById('btStatus').value;
1397+ const canonOnly = document.getElementById('btCanonical').checked;
14371398 if (s) p.set('q', s);
14381399 if (a) p.set('arch', a);
14391400 if (pf) p.set('org', pf);
14401401 if (sv !== '') p.set('status', sv);
1402+ if (canonOnly) p.set('canonical', '1');
14411403 if (sortCol) { p.set('sort', sortCol); p.set('dir', sortDir); }
14421404 const qs = p.toString();
14431405 history.replaceState(null, '', qs ? '?' + qs : location.pathname);
@@ -1532,6 +1494,7 @@ def copy_demos(_app: Optional[Any] = None):
15321494 document.getElementById('btArch').addEventListener('change', () => { populatePrefixFilter(); apply(); });
15331495 document.getElementById('btPrefix').addEventListener('change', apply);
15341496 document.getElementById('btStatus').addEventListener('change', apply);
1497+ document.getElementById('btCanonical').addEventListener('change', apply);
15351498 document.querySelectorAll('#bt-root th[data-sort]').forEach(th => {
15361499 th.addEventListener('click', () => {
15371500 const key = th.dataset.sort;
@@ -1548,15 +1511,16 @@ def copy_demos(_app: Optional[Any] = None):
15481511
15491512
15501513def generate_bridge_models_page ():
1551- """Generate the TransformerBridge models markdown page.
1514+ """Generate the TransformerBridge models markdown page."""
1515+ import json as _json
1516+
1517+ from transformer_lens .tools .model_registry import CANONICAL_AUTHORS_BY_ARCH
15521518
1553- The page fetches supported_models.json from _static/, which is a symlink
1554- to the canonical source at transformer_lens/tools/model_registry/data/.
1555- """
15561519 GENERATED_DIR .mkdir (exist_ok = True )
1557- ( GENERATED_DIR / "transformer_bridge_models.md" ). write_text (
1558- BRIDGE_MODELS_PAGE , encoding = "utf-8"
1520+ rendered = BRIDGE_MODELS_PAGE . replace (
1521+ "__OFFICIAL_ORGS_JSON__" , _json . dumps ( CANONICAL_AUTHORS_BY_ARCH , sort_keys = True )
15591522 )
1523+ (GENERATED_DIR / "transformer_bridge_models.md" ).write_text (rendered , encoding = "utf-8" )
15601524
15611525
15621526def docs_hot_reload ():
0 commit comments