Molbap HF Staff commited on
Commit
c34c7de
Β·
1 Parent(s): 3a0c25b

Recommit with PNGs tracked by LFS

Browse files
.gitattributes CHANGED
@@ -51,3 +51,4 @@ dist/static/graph_modular_related_models.png filter=lfs diff=lfs merge=lfs -text
51
  dist/static/Jaccard_similarity_plot.png filter=lfs diff=lfs merge=lfs -text
52
  dist/static/model_debugger.png filter=lfs diff=lfs merge=lfs -text
53
  dist/static/modular_candidates.png filter=lfs diff=lfs merge=lfs -text
 
 
51
  dist/static/Jaccard_similarity_plot.png filter=lfs diff=lfs merge=lfs -text
52
  dist/static/model_debugger.png filter=lfs diff=lfs merge=lfs -text
53
  dist/static/modular_candidates.png filter=lfs diff=lfs merge=lfs -text
54
+ *.png filter=lfs diff=lfs merge=lfs -text
content/article.md CHANGED
@@ -1,27 +1,17 @@
1
 
2
- ## Introduction
3
-
4
- The `transformers` library, built with `PyTorch`, supports all state-of-the-art LLMs, many VLMs, task-specific vision language models, video models, audio models, table models, classical encoders, to a global count of almost 400 models.
5
-
6
- The name of the library itself is mostly majority driven as many models are not even transformers architectures, like Mamba, Zamba, RWKV, and convolution-based models.
7
-
8
- Regardless, each of these is wrought by the research and engineering team that created them, then harmonized into a now famous interface, and callable with a simple `.from_pretrained` command.
9
-
10
- Inference works for all models, training is functional for most. The library is a foundation for many machine learning courses, cookbooks, and overall, several thousands other open-source libraries depend on it. All models are tested as part of a daily CI ensuring their preservation and reproducibility. Most importantly, it is _open-source_ and has been written by the community for a large part.
11
- This isn't really to brag but to set the stakes: what does it take to keep such a ship afloat, made of so many moving, unrelated parts?
12
-
13
- The ML wave has not stopped, there's more and more models being added, at a steadily growing rate. `Transformers` is widely used, and we read the feedback that users post online. Whether it's about a function that had 300+ keyword arguments, duplicated code and helpers, and mentions of `Copied from ... ` everywhere, along with optimisation concerns. Text-only models are relatively tamed, but multimodal models remain to be harmonized.
14
-
15
- Here we will dissect what is the new design philosophy of transformers, as a continuation from the existing older [philosophy](https://huggingface.co/docs/transformers/en/philosophy) page, and an accompanying [blog post from 2022](https://huggingface.co/blog/transformers-design-philosophy).
16
-
17
- More recently, and I recommend the read if it's not done yet, a blog post about [recent upgrades to transformers](https://huggingface.co/blog/faster-transformers) was written, explaining in particular what makes the library faster today.
18
-
19
- Some time ago I dare not say how long, we discussed with transformers maintainers about the state of features in transformers. A lot of recent developments were satisfactory, but if we were only talking about these, self-congratulation would be the only goalpost.
20
-
21
- Reflecting on this philosophy now, as models pile up, is essential and will drive new developments.
22
-
23
-
24
- ### What you will learn
25
 
26
  Every reader, whether an OSS maintainer, power user, or casual fine-tuner, will walk away knowing how to reason about the `transformers` code base, how to use it better, how to meaningfully contribute to it.
27
  This will also showcase new features you might have missed so you'll be up-to-date.
@@ -210,6 +200,8 @@ class GlmRMSNorm(nn.Module):
210
 
211
  Plus, this opened another angle of contribution for the community. People who are GPU whisperers can now contribute optimized kernels. You can check on the [kernel community blog post](https://huggingface.co/blog/hello-hf-kernels) to learn more about it!
212
 
 
 
213
  ## The good modularity
214
 
215
  Now, we have a form of inheritance in our codebase. Some models become standards, and model contributors are given the opportunity to _define standards_. Pushing the boundaries of scientific knowledge can translate into the boundaries of engineering if this effort is made, and we're striving for it.
@@ -232,11 +224,12 @@ As you can see, there is a small DETR island, a little llava pocket, and so on,
232
 
233
  Another problem is, this is only for `modular` models. Several models do NOT have a modular file.
234
 
235
- ## Too many models, yet not enough, are alike
236
 
237
  So I looked into Jaccard similarity, which we use to measure set differences. I know that code is more than a set of characters stringed together. I also used code embedding models to check out code similarities, and it yielded better results, for the needs of this blog post I will stick to Jaccard index.
238
 
239
- It is interesting, for that, to look at _when_ we deployed this modular logic and what was its rippling effect on the library:
 
240
  {{{fragment-model-timeline}}}
241
 
242
  If you've checked out llava, you've seen that llava_video is a red node, connected by a red edge to llava: it's a candidate, something that we can _likely_ remodularize, [not touching the actual model](#backwards-compatibility) but being much more readable with [DRY*](#do-repeat-yourself).
@@ -318,13 +311,15 @@ Cyclomatic complexity isn’t LOC, but they strongly correlate. As Les Hatton no
318
 
319
  {{{fragment-loc-growth}}}
320
 
 
 
321
  Of course, it is not only this effort that allowed to reduce the maintenance load. Externalising the [attention classes](#external-attention-classes) has moved out a lot of repeated code that was [standard](#standardize-dont-abstract).
322
 
323
- ## <a id="encoders-ftw"></a> The neverending stories of encoder models.
324
 
325
  Models popularity speaks for itself! This is because the usage of encoders lies in embeddings. So we have to keep the encoders part viable, usable, fine-tune-able.
326
 
327
- ![Popular models bar plot](static/popular_models_barplot.png)
328
 
329
  As the codebase grows, with our friend codebase [Sentence Transformers](https://huggingface.co/sentence-transformers), we need to maintain this one as well. Retrieval use-cases, smart dbs, like FAISS-based indexing rely on it, and thus indirectly on transformers.
330
 
@@ -332,7 +327,9 @@ As the codebase grows, with our friend codebase [Sentence Transformers](https://
332
 
333
  Choosing to be a `torch`-first software meant relieving a tremendous amount of support from `jax ` and `TensorFlow` , and it also meant that we could be more lenient into the amount of torch-dependent utilities that we were able to add. One of these is the _fast processing_ of images. Where they were before assumed to be minimal ndarrays, making stronger assumptions and enforcing `torch` and `torchvision`native inputs allowed up to speed up massively the processing time for each model.
334
 
335
- The gains in performance are immense, up to 20x speed for most models when compiled torchvision ops.
 
 
336
 
337
 
338
 
@@ -352,44 +349,55 @@ In that regard, we DO want to be a [modular toolbox](#modular-toolbox), being [m
352
  ### Attention visualisation
353
 
354
  If all models have the same API internally for attention computation, it allows us to build cool tools to visualize the inner workings of the attention mechanism. One particular piece of
355
- machinery is the `attention mask`, cause of confusion. Thankfully, we can fix it.
 
 
356
 
357
  {{{fragment-attention-visualizer}}}
358
 
359
- Because it is all PyTorch (and it is even more now that we support only PyTorch), we can easily debug any model when we want to add it to transformers. We now have a power-user tool for porting or adding models, that wraps a forward pass, intercepts every submodule call, and logs shapes, dtypes, and sample statistics of inputs/outputs to nested JSON.
360
 
361
- It just works with PyTorch models and is especially useful when aligning outputs with a reference implementation, aligned with our core guideline, [source of truth for model definitions](#source-of-truth).
 
 
 
 
362
 
363
  ![Model debugger interface](static/model_debugger.png)
364
 
365
- ### Transformers-serve
 
 
 
 
 
 
 
 
366
 
367
  Having all these models readily available allows to use all of them with transformers-serve, and enable interfacing with them with an Open API-like pattern.
368
 
369
  ```bash
370
- # Start serving a model with transformers serve
371
  transformers serve
372
 
373
- # Query the model using OpenAI-compatible API
374
- curl -X POST http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{"messages": [{"role": "system", "content": "hello"}], "temperature": 0.9, "max_tokens": 1000, "stream": true, "model": "Qwen/Qwen2.5-0.5B-Instruct"}'
 
375
  ```
376
 
377
- This provides an OpenAI-compatible API with features like continuous batching for better GPU utilization.
 
 
 
378
 
379
  ## Community reusability
380
 
381
-
382
- Adding a model to transformers means:
383
  - having it immediately available to the community
384
- - usable in vLLM, SGLang, and so on without additional code. In April 2025, transformers was added as a backend to run models on vLLM, which optimizes throughput/latency on top of existing transformers architectures [as seen in this great blog post.](https://blog.vllm.ai/2025/04/11/transformers-backend.html)
385
 
386
- This cements the need even more for a [consistent public surface](#consistent-public-surface): we are now a backend, and there's more optimized software than us to handle serving. At the time of writing, more effort is done in that direction. We already have compatible configs for VLMs for vLLM (say that three times fast), [here for GLM4 video support](https://github.com/huggingface/transformers/pull/40696/files),
387
 
388
- ## Cooking faster CUDA warmups
389
 
390
- Having a clean _external_ API allows us to work on the true inner workings of transformers. One of the few recent additions was the _CUDA warmup_ via `caching_allocator_warmup` which improved massively the loading footprint by pre-allocating GPU memory to avoid malloc bottlenecks during model loading.
391
-
392
- {{{fragment-warmup_demo}}}
393
 
394
  ## What is coming next
395
 
 
1
 
2
+ ## Introduction
3
+ The `transformers` library, built with `PyTorch`, supports all state-of-the-art LLMs, many VLMs, task-specific vision language models, video models, audio models, table models, classical encoders, to a global count of almost 400 models.
4
+ The name of the library itself is mostly majority driven as many models are not even transformers architectures, like Mamba, Zamba, RWKV, and convolution-based models.
5
+ Regardless, each of these is wrought by the research and engineering team that created them, then harmonized into a now famous interface, and callable with a simple `.from_pretrained` command.
6
+ Inference works for all models, training is functional for most. The library is a foundation for many machine learning courses, cookbooks, and overall, several thousands other open-source libraries depend on it. All models are tested as part of a daily CI ensuring their preservation and reproducibility. Most importantly, it is _open-source_ and has been written by the community for a large part.
7
+ This isn't really to brag but to set the stakes: what does it take to keep such a ship afloat, made of so many moving, unrelated parts?
8
+ The ML wave has not stopped, there's more and more models being added, at a steadily growing rate. `Transformers` is widely used, and we read the feedback that users post online. Whether it's about a function that had 300+ keyword arguments, duplicated code and helpers, and mentions of `Copied from ... ` everywhere, along with optimisation concerns. Text-only models are relatively tamed, but multimodal models remain to be harmonized.
9
+ Here we will dissect what is the new design philosophy of transformers, as a continuation from the existing older [philosophy](https://huggingface.co/docs/transformers/en/philosophy) page, and an accompanying [blog post from 2022](https://huggingface.co/blog/transformers-design-philosophy).
10
+ More recently, and I recommend the read if it's not done yet, a blog post about [recent upgrades to transformers](https://huggingface.co/blog/faster-transformers) was written, explaining in particular what makes the library faster today.
11
+ Some time ago I dare not say how long, we discussed with transformers maintainers about the state of features in transformers. A lot of recent developments were satisfactory, but if we were only talking about these, self-congratulation would be the only goalpost.
12
+ Reflecting on this philosophy now, as models pile up, is essential and will drive new developments.
13
+
14
+ ### The core tenets of transformers
 
 
 
 
 
 
 
 
 
 
15
 
16
  Every reader, whether an OSS maintainer, power user, or casual fine-tuner, will walk away knowing how to reason about the `transformers` code base, how to use it better, how to meaningfully contribute to it.
17
  This will also showcase new features you might have missed so you'll be up-to-date.
 
200
 
201
  Plus, this opened another angle of contribution for the community. People who are GPU whisperers can now contribute optimized kernels. You can check on the [kernel community blog post](https://huggingface.co/blog/hello-hf-kernels) to learn more about it!
202
 
203
+ Even more resources have been added, like the formidable [kernel builder](https://github.com/huggingface/kernel-builder) with its connected resources to [help you build kernels with it](https://github.com/huggingface/kernel-builder/blob/main/docs/writing-kernels.md) and [with nix](https://github.com/huggingface/kernel-builder/blob/main/docs/nix.md).
204
+
205
  ## The good modularity
206
 
207
  Now, we have a form of inheritance in our codebase. Some models become standards, and model contributors are given the opportunity to _define standards_. Pushing the boundaries of scientific knowledge can translate into the boundaries of engineering if this effort is made, and we're striving for it.
 
224
 
225
  Another problem is, this is only for `modular` models. Several models do NOT have a modular file.
226
 
227
+ ## Many models, but not enough yet, are alike
228
 
229
  So I looked into Jaccard similarity, which we use to measure set differences. I know that code is more than a set of characters stringed together. I also used code embedding models to check out code similarities, and it yielded better results, for the needs of this blog post I will stick to Jaccard index.
230
 
231
+ It is interesting, for that, to look at _when_ we deployed this modular logic and what was its rippling effect on the library. You can check the [larger space](https://huggingface.co/spaces/Molbap/transformers-modular-refactor) to play around, but the gist is: adding modular allowed to connect more and more models to solid reference points. We have a lot of gaps to fill in still.
232
+
233
  {{{fragment-model-timeline}}}
234
 
235
  If you've checked out llava, you've seen that llava_video is a red node, connected by a red edge to llava: it's a candidate, something that we can _likely_ remodularize, [not touching the actual model](#backwards-compatibility) but being much more readable with [DRY*](#do-repeat-yourself).
 
311
 
312
  {{{fragment-loc-growth}}}
313
 
314
+ There's a sharp drop near the end, it's due to us [removing support for Jax and TensorFlow](https://github.com/huggingface/transformers/commit/4df2529d79d75f44e70396df5888a32ffa02d61e#diff-60849db3e9922197854ef1cac92bf4aba08b5d7fd3fe6f3c16a3511e29e0eacc) library-wide.
315
+
316
  Of course, it is not only this effort that allowed to reduce the maintenance load. Externalising the [attention classes](#external-attention-classes) has moved out a lot of repeated code that was [standard](#standardize-dont-abstract).
317
 
318
+ ## <a id="encoders-ftw"></a> Embedding models, now and forever.
319
 
320
  Models popularity speaks for itself! This is because the usage of encoders lies in embeddings. So we have to keep the encoders part viable, usable, fine-tune-able.
321
 
322
+ {{{fragment-model-visualisation}}}
323
 
324
  As the codebase grows, with our friend codebase [Sentence Transformers](https://huggingface.co/sentence-transformers), we need to maintain this one as well. Retrieval use-cases, smart dbs, like FAISS-based indexing rely on it, and thus indirectly on transformers.
325
 
 
327
 
328
  Choosing to be a `torch`-first software meant relieving a tremendous amount of support from `jax ` and `TensorFlow` , and it also meant that we could be more lenient into the amount of torch-dependent utilities that we were able to add. One of these is the _fast processing_ of images. Where they were before assumed to be minimal ndarrays, making stronger assumptions and enforcing `torch` and `torchvision`native inputs allowed up to speed up massively the processing time for each model.
329
 
330
+ The gains in performance are immense, up to 20x speed for most models when compiled torchvision ops.
331
+
332
+ ![Fast Image Processors Performance](fast_image_processors.png)
333
 
334
 
335
 
 
349
  ### Attention visualisation
350
 
351
  If all models have the same API internally for attention computation, it allows us to build cool tools to visualize the inner workings of the attention mechanism. One particular piece of
352
+ machinery is the `attention mask`, cause of confusion.
353
+
354
+ Here you see the famous bidirectional attention pattern for the whole prefix (text + image) in PaliGemma and all Gemma2+ models, contrasting with the usual "causal-only" models.
355
 
356
  {{{fragment-attention-visualizer}}}
357
 
 
358
 
359
+ ### Logging entire model activations
360
+
361
+ Further, because it is all PyTorch (and it is even more now that we support only PyTorch), we can easily debug any model when we want to add it to transformers. We now have a power-user tool for porting or adding models, that wraps a forward pass, intercepts every submodule call, and logs shapes, dtypes, and sample statistics of inputs/outputs to nested JSON.
362
+
363
+ It just works with PyTorch models and is especially useful when aligning outputs with a reference implementation, aligned with our [core guideline](#source-of-truth).
364
 
365
  ![Model debugger interface](static/model_debugger.png)
366
 
367
+ ### Cooking faster CUDA warmups
368
+
369
+ Having a clean _external_ API allows us to work on the true inner workings of transformers. One of the few recent additions was the _CUDA warmup_ via `caching_allocator_warmup` which improved massively the loading footprint by pre-allocating GPU memory to avoid malloc bottlenecks during model loading.
370
+
371
+ {{{fragment-warmup_demo}}}
372
+
373
+ It's hard to overstate how much of a lifesaver that is when you're trying to load a model as fast as possible, your iteration speed.
374
+
375
+ ## Transformers-serve and continuous batching
376
 
377
  Having all these models readily available allows to use all of them with transformers-serve, and enable interfacing with them with an Open API-like pattern.
378
 
379
  ```bash
 
380
  transformers serve
381
 
382
+ curl -X POST http://localhost:8000/v1/chat/completions \
383
+ -H "Content-Type: application/json" \
384
+ -d '{"messages": [{"role": "system", "content": "hello"}], "temperature": 0.9, "max_tokens": 1000, "stream": true, "model": "Qwen/Qwen2.5-0.5B-Instruct"}'
385
  ```
386
 
387
+ This provides an OpenAI-compatible API with features like [continuous batching](https://github.com/huggingface/transformers/pull/38085) (also check [here](https://github.com/huggingface/transformers/pull/40426)) for better GPU utilization.
388
+
389
+ Continuous batching is in itself very much linked to the great work of vLLM with the `paged attention kernel`, further justifying the facilitation of [external kernels](#community-kernels).
390
+
391
 
392
  ## Community reusability
393
 
394
+ Transformers-serve is transformers-first, for sure, but it's not limited to that. Adding a model to transformers means:
 
395
  - having it immediately available to the community
396
+ - having it immediately usable in vLLM, SGLang, and so on without additional code. In April 2025, transformers was added as a backend to run models on vLLM, which optimizes throughput/latency on top of existing transformers architectures [as seen in this great blog post.](https://blog.vllm.ai/2025/04/11/transformers-backend.html)
397
 
398
+ This cements the need even more for a [consistent public surface](#consistent-public-surface): we are now a backend, and there's more optimized software than us to handle serving. At the time of writing, more effort is done in that direction. We already have compatible configs for VLMs for vLLM (say that three times fast), [here for GLM4 video support](https://github.com/huggingface/transformers/pull/40696/files), and here for [MoE support](https://github.com/huggingface/transformers/pull/40132) for instance.
399
 
 
400
 
 
 
 
401
 
402
  ## What is coming next
403
 
content/fast_image_processors.png ADDED

Git LFS Details

  • SHA256: 9e981efa2635c9b7dfef9c03e9e7233316d87f057d71bae7429b9830ca065827
  • Pointer size: 131 Bytes
  • Size of remote file: 407 kB
dist/fragments/attention-visualizer.html CHANGED
@@ -1,102 +1,45 @@
1
- <div style="border: 1px solid #e2e8f0; border-radius: 8px; background: white; margin: 1.5rem 0;">
2
- <div style="padding: 1rem; border-bottom: 1px solid #e2e8f0; background: #f8f9fa;">
3
- <h4 style="margin: 0 0 0.5rem 0; color: #495057;">πŸ” Attention Mask Visualizer</h4>
4
- <p style="margin: 0; font-size: 0.9em; color: #6c757d;">
5
- Visualize attention patterns in transformer models. This helps debug attention mask issues.
6
- </p>
 
7
  </div>
8
-
9
- <div style="padding: 1rem;">
10
- <div style="display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; margin-bottom: 1rem;">
11
- <div>
12
- <label style="display: block; font-weight: 600; margin-bottom: 0.5rem; color: #374151;">Model:</label>
13
- <select id="model-select" style="width: 100%; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; background: white;">
14
- <option value="openai-community/gpt2">openai-community/gpt2</option>
15
- <option value="google/gemma-2-2b">google/gemma-2-2b</option>
16
- <option value="microsoft/DialoGPT-small">microsoft/DialoGPT-small</option>
17
- </select>
18
- </div>
19
-
20
- <div>
21
- <label style="display: block; font-weight: 600; margin-bottom: 0.5rem; color: #374151;">Action:</label>
22
- <button id="visualize-btn" style="padding: 0.5rem 1rem; background: #3b82f6; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 500;">
23
- πŸš€ Visualize
24
- </button>
25
- </div>
26
- </div>
27
-
28
- <div style="margin-bottom: 1rem;">
29
- <label style="display: block; font-weight: 600; margin-bottom: 0.5rem; color: #374151;">Prompt:</label>
30
- <textarea id="prompt-input"
31
- style="width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; resize: vertical; font-family: monospace; font-size: 0.9em;"
32
- rows="3"
33
- placeholder="You are an assistant. Make sure you print me."></textarea>
34
- </div>
35
-
36
- <div id="attention-output" style="min-height: 200px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; padding: 1rem;">
37
- <div style="text-align: center; color: #6c757d; font-style: italic;">
38
- Click "Visualize" to generate attention visualization
39
- </div>
40
- </div>
41
- </div>
42
-
43
- <div style="padding: 1rem; border-top: 1px solid #e2e8f0; background: #f8f9fa; font-size: 0.9em; color: #6c757d;">
44
- <strong>Note:</strong> This is a demonstration. In the original Gradio app, this would use GPU processing with ZeroGPU
45
- to generate real attention visualizations from transformer models.
46
- </div>
47
- </div>
48
 
49
- <script>
50
- document.addEventListener('DOMContentLoaded', function() {
51
- const modelSelect = document.getElementById('model-select');
52
- const promptInput = document.getElementById('prompt-input');
53
- const visualizeBtn = document.getElementById('visualize-btn');
54
- const output = document.getElementById('attention-output');
55
-
56
- // Set default prompt
57
- promptInput.value = "You are an assistant. Make sure you print me.";
58
-
59
- visualizeBtn.addEventListener('click', function() {
60
- const model = modelSelect.value;
61
- const prompt = promptInput.value.trim();
62
-
63
- if (!prompt) {
64
- output.innerHTML = '<div style="color: #e53e3e;">Please enter a prompt</div>';
65
- return;
66
- }
67
-
68
- // Show loading state
69
- visualizeBtn.disabled = true;
70
- visualizeBtn.textContent = 'Processing...';
71
- output.innerHTML = '<div style="text-align: center; color: #6c757d;"><em>Generating attention visualization...</em></div>';
72
-
73
- // Simulate processing time
74
- setTimeout(() => {
75
- // Generate mock attention visualization
76
- const tokens = prompt.split(' ').slice(0, 8); // Limit tokens for demo
77
- let html = '<div style="margin-bottom: 1rem;"><strong>Model:</strong> ' + model + '</div>';
78
- html += '<div style="margin-bottom: 1rem;"><strong>Tokens:</strong> ' + tokens.join(' β€’ ') + '</div>';
79
- html += '<div><strong>Attention Matrix (Layer 0, Head 0):</strong></div>';
80
- html += '<table style="margin-top: 0.5rem; border-collapse: collapse; font-family: monospace; font-size: 0.8em;">';
81
-
82
- // Generate attention matrix visualization
83
- for (let i = 0; i < tokens.length; i++) {
84
- html += '<tr>';
85
- for (let j = 0; j < tokens.length; j++) {
86
- const attention = Math.random();
87
- const opacity = attention;
88
- const color = `rgba(59, 130, 246, ${opacity})`;
89
- html += `<td style="border: 1px solid #ddd; padding: 4px; background: ${color}; text-align: center; min-width: 40px;">${attention.toFixed(2)}</td>`;
90
- }
91
- html += '</tr>';
92
- }
93
- html += '</table>';
94
- html += '<div style="margin-top: 1rem; font-size: 0.9em; color: #6c757d;"><em>Darker blue = higher attention weight</em></div>';
95
-
96
- output.innerHTML = html;
97
- visualizeBtn.disabled = false;
98
- visualizeBtn.textContent = 'πŸš€ Visualize';
99
- }, 2000);
100
- });
101
- });
102
- </script>
 
1
+ <!-- Minimal HTML fragment: terminal-style ASCII attention masks -->
2
+ <div style="max-width: 940px; margin: 16px 0; border:1px solid #2a2f3a; border-radius:8px; background:#0b0f19; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; color:#e5e7eb;">
3
+ <div style="display:flex; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid #1f2430; background:#111827; border-top-left-radius:8px; border-top-right-radius:8px;">
4
+ <span style="width:10px; height:10px; background:#ef4444; border-radius:50%; display:inline-block;"></span>
5
+ <span style="width:10px; height:10px; background:#f59e0b; border-radius:50%; display:inline-block;"></span>
6
+ <span style="width:10px; height:10px; background:#22c55e; border-radius:50%; display:inline-block;"></span>
7
+ <span style="margin-left:8px; font-size:12px; color:#9ca3af;">attention-mask-visualizer</span>
8
  </div>
9
+ <div style="padding:12px 14px; overflow:auto; font-size:12.5px; line-height:1.4;">
10
+ <pre style="margin:0; white-space:pre; tab-size:2;">
11
+ ATTN MASK β€” GPT-2 (causal)
12
+ Tokens: [The, cat, sat, on, the, mat]
13
+ Legend: x = can attend, . = masked (future)
14
+
15
+ The cat sat on the mat
16
+ The x
17
+ cat x x
18
+ sat x x x
19
+ on x x x x
20
+ the x x x x x
21
+ mat x x x x x x
22
+
23
+
24
+ ATTN MASK β€” PaliGemma-style (bidirectional prefix + causal suffix)
25
+ Prefix: [&lt;i0&gt; &lt;i1&gt; &lt;i2&gt; &lt;i3&gt; &lt;i4&gt; What is this]
26
+ Suffix: [A great duck]
27
+ Legend: βœ“ = can attend, βœ— = cannot
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ &lt;i0&gt;&lt;i1&gt;&lt;i2&gt;&lt;i3&gt;&lt;i4&gt; What is this | A great duck
30
+ &lt;i0&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
31
+ &lt;i1&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
32
+ &lt;i2&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
33
+ &lt;i3&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
34
+ &lt;i4&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
35
+ What βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
36
+ is βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
37
+ this βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
38
+ --------------------------------------------------------------------
39
+ A βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ—
40
+ great βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ—
41
+ duck βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“
42
+ </pre>
43
+ </div>
44
+ </div>
45
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dist/fragments/dependency-graph.html CHANGED
@@ -1,14 +1,6 @@
1
- <script type="module" src="https://gradio.s3-us-west-2.amazonaws.com/4.0/gradio.js"></script>
2
-
3
- <section id="modular-explorer" data-no-toc style="margin:2rem 0">
4
- <h2 style="margin:0 0 .5rem 0">πŸ” Modular-candidate explorer (live)</h2>
5
- <div style="position:relative; padding-top:62.5%; border:1px solid rgba(0,0,0,.08); border-radius:12px; overflow:hidden; background:#fff">
6
- <gradio-app
7
- src="https://molbap-transformers-modular-refactor.hf.space?tab=graph"
8
- style="position:absolute; inset:0; width:100%; height:100%; border:0"
9
- ></gradio-app>
10
- </div>
11
- <p class="figcaption" style="margin:.6rem 0 0 0">
12
- Opens full app: <a href="https://huggingface.co/spaces/Molbap/transformers-modular-refactor" target="_blank" rel="noopener">Space page</a>.
13
- </p>
14
- </section>
 
1
+ <iframe
2
+ src="https://molbap-dependencies-1.hf.space"
3
+ style="width:100%; height:680px; border:0"
4
+ allow="clipboard-read; clipboard-write; fullscreen"
5
+ referrerpolicy="no-referrer-when-downgrade"
6
+ ></iframe>
 
 
 
 
 
 
 
 
dist/fragments/loc-growth.html CHANGED
@@ -1,267 +1,6 @@
1
- <style>
2
- .loc-growth-container {
3
- margin: 2rem 0;
4
- border: 1px solid #e5e7eb;
5
- border-radius: 12px;
6
- overflow: hidden;
7
- background: white;
8
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
9
- }
10
-
11
- .loc-growth-header {
12
- background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
13
- color: white;
14
- padding: 1rem 1.5rem;
15
- }
16
-
17
- .loc-growth-header h3 {
18
- margin: 0;
19
- font-size: 1.25rem;
20
- font-weight: 600;
21
- }
22
-
23
- .loc-growth-controls {
24
- padding: 1rem 1.5rem;
25
- background: #f8f9fa;
26
- border-bottom: 1px solid #e5e7eb;
27
- display: flex;
28
- gap: 1rem;
29
- align-items: center;
30
- flex-wrap: wrap;
31
- }
32
-
33
- .loc-growth-control {
34
- display: flex;
35
- align-items: center;
36
- gap: 0.5rem;
37
- }
38
-
39
- .loc-growth-control label {
40
- font-size: 0.875rem;
41
- font-weight: 500;
42
- color: #374151;
43
- }
44
-
45
- .loc-growth-control select {
46
- padding: 0.5rem;
47
- border: 1px solid #d1d5db;
48
- border-radius: 6px;
49
- background: white;
50
- font-size: 0.875rem;
51
- }
52
-
53
- .loc-growth-control input[type="checkbox"] {
54
- width: 16px;
55
- height: 16px;
56
- accent-color: #4facfe;
57
- }
58
-
59
- .loc-growth-iframe {
60
- width: 100%;
61
- height: 450px;
62
- border: none;
63
- background: white;
64
- }
65
-
66
- .loc-growth-footer {
67
- padding: 1rem 1.5rem;
68
- background: #f8f9fa;
69
- font-size: 0.875rem;
70
- color: #6b7280;
71
- line-height: 1.5;
72
- }
73
- </style>
74
-
75
- <div class="loc-growth-container">
76
- <div class="loc-growth-header">
77
- <h3 data-no-toc">πŸ“ˆ Lines of Code Growth Analysis</h3>
78
- </div>
79
-
80
- <div class="loc-growth-controls">
81
- <div class="loc-growth-control">
82
- <label for="similarity-metric">Similarity metric:</label>
83
- <select id="similarity-metric">
84
- <option value="jaccard">Jaccard</option>
85
- <option value="embedding">Embedding</option>
86
- </select>
87
- </div>
88
-
89
- <div class="loc-growth-control">
90
- <input type="checkbox" id="loc-multimodal-only">
91
- <label for="loc-multimodal-only">Only multimodal models</label>
92
- </div>
93
-
94
- <div class="loc-growth-control">
95
- <button id="update-loc" style="padding: 0.5rem 1rem; background: #4facfe; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.875rem;">
96
- Update Chart
97
- </button>
98
- </div>
99
- </div>
100
-
101
- <iframe id="loc-frame" class="loc-growth-iframe" src="about:blank"></iframe>
102
-
103
- <div class="loc-growth-footer">
104
- <strong>Lines of code growth</strong> showing how the codebase has evolved over time.
105
- This analysis reveals the impact of modularization efforts on code duplication and maintainability.
106
- Different similarity metrics provide insights into various aspects of code relationships.
107
- </div>
108
- </div>
109
-
110
- <script>
111
- (function() {
112
- const metricSelect = document.getElementById('similarity-metric');
113
- const multimodalCheckbox = document.getElementById('loc-multimodal-only');
114
- const updateButton = document.getElementById('update-loc');
115
- const locFrame = document.getElementById('loc-frame');
116
-
117
- function updateLOC() {
118
- const metric = metricSelect.value;
119
- const multimodal = multimodalCheckbox.checked;
120
-
121
- updateButton.textContent = 'Loading...';
122
- updateButton.disabled = true;
123
-
124
- // Create a LOC growth visualization
125
- const locHtml = `
126
- <!DOCTYPE html>
127
- <html>
128
- <head>
129
- <script src="https://d3js.org/d3.v7.min.js"></script>
130
- <style>
131
- body { margin: 0; padding: 20px; font-family: system-ui, sans-serif; background: #fafafa; }
132
- .loading { text-align: center; padding: 50px; color: #6b7280; }
133
- .chart-container { background: white; border-radius: 8px; padding: 20px; }
134
- .chart-title { text-align: center; font-weight: 600; margin-bottom: 20px; color: #374151; }
135
- .axis { font-size: 12px; }
136
- .line { fill: none; stroke-width: 2px; }
137
- .line.total { stroke: #4facfe; }
138
- .line.modular { stroke: #10b981; }
139
- .line.non-modular { stroke: #f59e0b; }
140
- .legend { font-size: 12px; }
141
- .legend-item { margin-right: 20px; }
142
- .legend-color { width: 12px; height: 12px; display: inline-block; margin-right: 5px; }
143
- .tooltip {
144
- position: absolute;
145
- background: rgba(0,0,0,0.8);
146
- color: white;
147
- padding: 8px;
148
- border-radius: 4px;
149
- font-size: 12px;
150
- pointer-events: none;
151
- opacity: 0;
152
- }
153
- </style>
154
- </head>
155
- <body>
156
- <div class="loading">Loading LOC growth analysis using ${metric} similarity${multimodal ? ' (multimodal only)' : ''}...</div>
157
- <div class="chart-container" id="chart-content" style="display: none;">
158
- <div class="chart-title">Lines of Code Growth Over Time</div>
159
- <div class="legend" style="text-align: center; margin-bottom: 20px;">
160
- <span class="legend-item">
161
- <span class="legend-color" style="background: #4facfe;"></span>Total LOC
162
- </span>
163
- <span class="legend-item">
164
- <span class="legend-color" style="background: #10b981;"></span>Modular Models
165
- </span>
166
- <span class="legend-item">
167
- <span class="legend-color" style="background: #f59e0b;"></span>Non-Modular Models
168
- </span>
169
- </div>
170
- <svg id="loc-chart" width="100%" height="300"></svg>
171
- <div style="margin-top: 20px; font-size: 0.875rem; color: #6b7280; text-align: center;">
172
- <p><strong>Key Insights:</strong></p>
173
- <p>β€’ Modularization reduces code duplication and maintenance overhead</p>
174
- <p>β€’ The ${metric} metric shows ${multimodal ? 'multimodal' : 'all'} model relationships</p>
175
- <p>β€’ Growth trends indicate the effectiveness of the modular approach</p>
176
- </div>
177
- </div>
178
- <div class="tooltip"></div>
179
- <script>
180
- // Sample LOC growth data
181
- const sampleLOCData = [
182
- { date: '2022-01', total: 125000, modular: 15000, nonModular: 110000 },
183
- { date: '2022-06', total: 180000, modular: 35000, nonModular: 145000 },
184
- { date: '2023-01', total: 220000, modular: 65000, nonModular: 155000 },
185
- { date: '2023-06', total: 245000, modular: 95000, nonModular: 150000 },
186
- { date: '2024-01', total: 260000, modular: 125000, nonModular: 135000 },
187
- { date: '2024-06', total: 270000, modular: 155000, nonModular: 115000 }
188
- ];
189
-
190
- setTimeout(() => {
191
- const loadingDiv = document.querySelector('.loading');
192
- const chartDiv = document.getElementById('chart-content');
193
-
194
- // Simple chart rendering
195
- const svg = d3.select('#loc-chart');
196
- const margin = {top: 20, right: 30, bottom: 40, left: 60};
197
- const width = 500 - margin.left - margin.right;
198
- const height = 300 - margin.top - margin.bottom;
199
-
200
- const parseDate = d3.timeParse('%Y-%m');
201
- const data = sampleLOCData.map(d => ({
202
- ...d,
203
- date: parseDate(d.date)
204
- }));
205
-
206
- const x = d3.scaleTime()
207
- .domain(d3.extent(data, d => d.date))
208
- .range([0, width]);
209
-
210
- const y = d3.scaleLinear()
211
- .domain([0, d3.max(data, d => d.total)])
212
- .range([height, 0]);
213
-
214
- const g = svg.append('g')
215
- .attr('transform', \`translate(\${margin.left},\${margin.top})\`);
216
-
217
- // Add axes
218
- g.append('g')
219
- .attr('transform', \`translate(0,\${height})\`)
220
- .call(d3.axisBottom(x).tickFormat(d3.timeFormat('%Y-%m')));
221
-
222
- g.append('g')
223
- .call(d3.axisLeft(y).tickFormat(d => (d/1000) + 'k'));
224
-
225
- // Add lines
226
- const line = d3.line()
227
- .x(d => x(d.date))
228
- .y(d => y(d.value));
229
-
230
- const lines = [
231
- { key: 'total', color: '#4facfe', data: data.map(d => ({date: d.date, value: d.total})) },
232
- { key: 'modular', color: '#10b981', data: data.map(d => ({date: d.date, value: d.modular})) },
233
- { key: 'nonModular', color: '#f59e0b', data: data.map(d => ({date: d.date, value: d.nonModular})) }
234
- ];
235
-
236
- lines.forEach(lineData => {
237
- g.append('path')
238
- .datum(lineData.data)
239
- .attr('class', 'line')
240
- .attr('d', line)
241
- .style('stroke', lineData.color);
242
- });
243
-
244
- loadingDiv.style.display = 'none';
245
- chartDiv.style.display = 'block';
246
- }, 1000);
247
- </script>
248
- </body>
249
- </html>`;
250
-
251
- // Encode the HTML for the iframe
252
- const encodedHtml = 'data:text/html;charset=utf-8,' + encodeURIComponent(locHtml);
253
- locFrame.src = encodedHtml;
254
-
255
- setTimeout(() => {
256
- updateButton.textContent = 'Update Chart';
257
- updateButton.disabled = false;
258
- }, 1000);
259
- }
260
-
261
- // Initial load
262
- updateLOC();
263
-
264
- // Update on button click
265
- updateButton.addEventListener('click', updateLOC);
266
- })();
267
- </script>
 
1
+ <iframe
2
+ src="https://molbap-loc-1.hf.space"
3
+ style="width:100%; height:680px; border:0"
4
+ allow="clipboard-read; clipboard-write; fullscreen"
5
+ referrerpolicy="no-referrer-when-downgrade"
6
+ ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dist/fragments/model-timeline.html CHANGED
@@ -1,254 +1,6 @@
1
- <style>
2
- .model-timeline-container {
3
- margin: 2rem 0;
4
- border: 1px solid #e5e7eb;
5
- border-radius: 12px;
6
- overflow: hidden;
7
- background: white;
8
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
9
- }
10
-
11
- .model-timeline-header {
12
- background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
13
- color: white;
14
- padding: 1rem 1.5rem;
15
- }
16
-
17
- .model-timeline-header h3 {
18
- margin: 0;
19
- font-size: 1.25rem;
20
- font-weight: 600;
21
- }
22
-
23
- .model-timeline-controls {
24
- padding: 1rem 1.5rem;
25
- background: #f8f9fa;
26
- border-bottom: 1px solid #e5e7eb;
27
- display: flex;
28
- gap: 1rem;
29
- align-items: center;
30
- flex-wrap: wrap;
31
- }
32
-
33
- .model-timeline-control {
34
- display: flex;
35
- align-items: center;
36
- gap: 0.5rem;
37
- }
38
-
39
- .model-timeline-control label {
40
- font-size: 0.875rem;
41
- font-weight: 500;
42
- color: #374151;
43
- }
44
-
45
- .model-timeline-control input[type="range"] {
46
- width: 120px;
47
- height: 4px;
48
- background: #e5e7eb;
49
- border-radius: 2px;
50
- outline: none;
51
- -webkit-appearance: none;
52
- }
53
-
54
- .model-timeline-control input[type="range"]::-webkit-slider-thumb {
55
- -webkit-appearance: none;
56
- width: 16px;
57
- height: 16px;
58
- background: #f5576c;
59
- border-radius: 50%;
60
- cursor: pointer;
61
- }
62
-
63
- .model-timeline-control input[type="checkbox"] {
64
- width: 16px;
65
- height: 16px;
66
- accent-color: #f5576c;
67
- }
68
-
69
- .model-timeline-control .threshold-value {
70
- font-weight: 600;
71
- color: #f5576c;
72
- min-width: 40px;
73
- }
74
-
75
- .model-timeline-iframe {
76
- width: 100%;
77
- height: 500px;
78
- border: none;
79
- background: white;
80
- }
81
-
82
- .model-timeline-footer {
83
- padding: 1rem 1.5rem;
84
- background: #f8f9fa;
85
- font-size: 0.875rem;
86
- color: #6b7280;
87
- line-height: 1.5;
88
- }
89
- </style>
90
-
91
- <div class="model-timeline-container">
92
- <div class="model-timeline-header">
93
- <h3 data-no-toc">πŸ“… Model Evolution Timeline</h3>
94
- </div>
95
-
96
- <div class="model-timeline-controls">
97
- <div class="model-timeline-control">
98
- <label for="timeline-similarity-threshold">Similarity β‰₯</label>
99
- <input type="range" id="timeline-similarity-threshold" min="0.5" max="0.95" step="0.01" value="0.6">
100
- <span class="threshold-value" id="timeline-threshold-display">0.60</span>
101
- </div>
102
-
103
- <div class="model-timeline-control">
104
- <input type="checkbox" id="timeline-multimodal-only">
105
- <label for="timeline-multimodal-only">Only multimodal models</label>
106
- </div>
107
-
108
- <div class="model-timeline-control">
109
- <button id="update-timeline" style="padding: 0.5rem 1rem; background: #f5576c; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.875rem;">
110
- Update Timeline
111
- </button>
112
- </div>
113
- </div>
114
-
115
- <iframe id="timeline-frame" class="model-timeline-iframe" src="about:blank"></iframe>
116
-
117
- <div class="model-timeline-footer">
118
- <strong>Chronological model evolution</strong> showing when similar models were added to the library.
119
- This timeline helps identify patterns in model development and the emergence of model families over time.
120
- Higher similarity thresholds reveal closer relationships between models.
121
- </div>
122
- </div>
123
-
124
- <script>
125
- (function() {
126
- const thresholdSlider = document.getElementById('timeline-similarity-threshold');
127
- const thresholdDisplay = document.getElementById('timeline-threshold-display');
128
- const multimodalCheckbox = document.getElementById('timeline-multimodal-only');
129
- const updateButton = document.getElementById('update-timeline');
130
- const timelineFrame = document.getElementById('timeline-frame');
131
-
132
- // Update threshold display
133
- thresholdSlider.addEventListener('input', function() {
134
- thresholdDisplay.textContent = parseFloat(this.value).toFixed(2);
135
- });
136
-
137
- function updateTimeline() {
138
- const threshold = parseFloat(thresholdSlider.value);
139
- const multimodal = multimodalCheckbox.checked;
140
-
141
- updateButton.textContent = 'Loading...';
142
- updateButton.disabled = true;
143
-
144
- // Create a timeline visualization
145
- const timelineHtml = `
146
- <!DOCTYPE html>
147
- <html>
148
- <head>
149
- <script src="https://d3js.org/d3.v7.min.js"></script>
150
- <style>
151
- body { margin: 0; padding: 20px; font-family: system-ui, sans-serif; background: #fafafa; }
152
- .loading { text-align: center; padding: 50px; color: #6b7280; }
153
- .timeline-container { max-width: 100%; margin: 0 auto; }
154
- .timeline-item {
155
- background: white;
156
- margin: 10px 0;
157
- padding: 15px;
158
- border-radius: 8px;
159
- border-left: 4px solid #f5576c;
160
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
161
- }
162
- .timeline-date { font-weight: 600; color: #f5576c; font-size: 0.875rem; }
163
- .timeline-model { font-weight: 500; margin: 5px 0; }
164
- .timeline-similarity { font-size: 0.75rem; color: #6b7280; }
165
- .metric-badge {
166
- display: inline-block;
167
- background: #f3f4f6;
168
- padding: 2px 8px;
169
- border-radius: 12px;
170
- font-size: 0.75rem;
171
- margin-left: 10px;
172
- }
173
- </style>
174
- </head>
175
- <body>
176
- <div class="loading">Loading model timeline with threshold β‰₯ ${threshold}${multimodal ? ' (multimodal only)' : ''}...</div>
177
- <div class="timeline-container" id="timeline-content" style="display: none;">
178
- <!-- Timeline content will be inserted here -->
179
- </div>
180
- <script>
181
- // Sample timeline data (in a real implementation, this would come from the API)
182
- const sampleTimelineData = [
183
- { date: '2023-01', model: 'LLaVA-1.5', similarity: 0.85, type: 'multimodal' },
184
- { date: '2023-03', model: 'LLaVA-NeXT', similarity: 0.92, type: 'multimodal' },
185
- { date: '2023-06', model: 'Qwen-VL', similarity: 0.71, type: 'multimodal' },
186
- { date: '2023-09', model: 'LLaVA-NeXT-Video', similarity: 0.88, type: 'multimodal' },
187
- { date: '2024-01', model: 'Qwen2-VL', similarity: 0.76, type: 'multimodal' }
188
- ];
189
-
190
- setTimeout(() => {
191
- const filteredData = sampleTimelineData.filter(item => {
192
- if (${multimodal} && item.type !== 'multimodal') return false;
193
- return item.similarity >= ${threshold};
194
- });
195
-
196
- const loadingDiv = document.querySelector('.loading');
197
- const timelineDiv = document.getElementById('timeline-content');
198
-
199
- if (filteredData.length === 0) {
200
- loadingDiv.innerHTML = \`
201
- <div style="text-align: center; padding: 40px; color: #6b7280;">
202
- <p>πŸ“Š No models found with similarity β‰₯ ${threshold}</p>
203
- <p style="font-size: 0.875rem;">Try lowering the similarity threshold to see more model relationships.</p>
204
- </div>
205
- \`;
206
- return;
207
- }
208
-
209
- let timelineHTML = '';
210
- filteredData.forEach(item => {
211
- timelineHTML += \`
212
- <div class="timeline-item">
213
- <div class="timeline-date">\${item.date}</div>
214
- <div class="timeline-model">\${item.model}</div>
215
- <div class="timeline-similarity">
216
- Similarity: \${item.similarity.toFixed(2)}
217
- <span class="metric-badge">\${item.type}</span>
218
- </div>
219
- </div>
220
- \`;
221
- });
222
-
223
- timelineDiv.innerHTML = timelineHTML;
224
- loadingDiv.style.display = 'none';
225
- timelineDiv.style.display = 'block';
226
- }, 1000);
227
- </script>
228
- </body>
229
- </html>`;
230
-
231
- // Encode the HTML for the iframe
232
- const encodedHtml = 'data:text/html;charset=utf-8,' + encodeURIComponent(timelineHtml);
233
- timelineFrame.src = encodedHtml;
234
-
235
- setTimeout(() => {
236
- updateButton.textContent = 'Update Timeline';
237
- updateButton.disabled = false;
238
- }, 1000);
239
- }
240
-
241
- // Initial load
242
- updateTimeline();
243
-
244
- // Update on button click
245
- updateButton.addEventListener('click', updateTimeline);
246
-
247
- // Update on Enter key in slider
248
- thresholdSlider.addEventListener('keydown', function(e) {
249
- if (e.key === 'Enter') {
250
- updateTimeline();
251
- }
252
- });
253
- })();
254
- </script>
 
1
+ <iframe
2
+ src="https://molbap-timeline-1.hf.space"
3
+ style="width:100%; height:680px; border:0"
4
+ allow="clipboard-read; clipboard-write; fullscreen"
5
+ referrerpolicy="no-referrer-when-downgrade"
6
+ ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dist/fragments/model-visualisation.html ADDED
The diff for this file is too large to render. See raw diff
 
dist/fragments/warmup_demo.html CHANGED
@@ -243,7 +243,7 @@
243
 
244
  <div class="demo-container">
245
  <div class="side no-warmup">
246
- <h2 data-no-toc>❌ Without Warmup</h2>
247
  <div class="timing" id="noWarmupTime">0.00s</div>
248
  <div class="layer-counter" id="noWarmupCounter">Layers loaded: 0/10</div>
249
  <div class="phase-indicator" id="noWarmupPhase"></div>
@@ -258,7 +258,7 @@
258
  </div>
259
 
260
  <div class="side with-warmup">
261
- <h2 data-no-toc>βœ… With Warmup</h2>
262
  <div class="timing" id="warmupTime">0.00s</div>
263
  <div class="layer-counter" id="warmupCounter">Layers loaded: 0/10</div>
264
  <div class="phase-indicator" id="warmupPhase"></div>
 
243
 
244
  <div class="demo-container">
245
  <div class="side no-warmup">
246
+ <h4 data-no-toc>❌ Without Warmup</h4>
247
  <div class="timing" id="noWarmupTime">0.00s</div>
248
  <div class="layer-counter" id="noWarmupCounter">Layers loaded: 0/10</div>
249
  <div class="phase-indicator" id="noWarmupPhase"></div>
 
258
  </div>
259
 
260
  <div class="side with-warmup">
261
+ <h4 data-no-toc>βœ… With Warmup</h4>
262
  <div class="timing" id="warmupTime">0.00s</div>
263
  <div class="layer-counter" id="warmupCounter">Layers loaded: 0/10</div>
264
  <div class="phase-indicator" id="warmupPhase"></div>
dist/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
dist/main.bundle.js CHANGED
@@ -1201,20 +1201,22 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/* Transformers-specific styling addit
1201
  counter-reset: tenet-counter -1; /* Start from 0 */
1202
  list-style: none;
1203
  padding-left: 0;
1204
- display: flex;
1205
- flex-direction: column;
1206
- gap: 2rem;
 
 
1207
  }
1208
 
1209
  .tenet-list li.tenet {
1210
  counter-increment: tenet-counter;
1211
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
1212
- border: 2px solid transparent;
1213
  border-radius: 16px;
1214
  padding: 2rem 2rem 2rem 4rem;
1215
  margin: 0;
1216
  position: relative;
1217
- box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
1218
  transition: all 0.3s ease;
1219
  cursor: pointer;
1220
  }
@@ -1301,6 +1303,12 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/* Transformers-specific styling addit
1301
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
1302
  }
1303
 
 
 
 
 
 
 
1304
  .interactive-demo .demo-header {
1305
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1306
  color: white;
@@ -1854,7 +1862,7 @@ d-article .memory-chart-container {
1854
  .interactive-demo .demo-content {
1855
  padding: 1rem;
1856
  }
1857
- }`, "",{"version":3,"sources":["webpack://./src/transformers-custom.css"],"names":[],"mappings":"AAAA,4CAA4C;;AAE5C,2BAA2B;AAC3B;IACI,aAAa;IACb,8BAA8B;IAC9B,WAAW;IACX,cAAc;IACd,kBAAkB;AACtB;;AAEA;IACI,mBAAmB;IACnB,yBAAyB;IACzB,kBAAkB;IAClB,gBAAgB;IAChB,wCAAwC;AAC5C;;AAEA;IACI,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,cAAc;IACd,gCAAgC;IAChC,gBAAgB;AACpB;;AAEA;IACI,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;AACpB;;AAE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B;IAClB,mDAAmD;IACnD,oBAAoB;IACpB,yCAAyC;IACzC,kBAAkB;AACtB;;AAEA,mBAAmB;AACnB;;;;;;;;;IASI,WAAW;IACX,kBAAkB;IAClB,YAAY;IACZ,SAAS;IACT,2BAA2B;IAC3B,6BAA6B;IAC7B,yBAAyB;IACzB,aAAa;IACb,UAAU;IACV,kBAAkB;IAClB,mDAAmD;AACvD;;AAEA,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;IAkBI,UAAU;IACV,mBAAmB;AACvB;;AAEA,+BAA+B;AAC/B;IACI,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,8BAA8B;IAC9B,4DAA4D;IAC5D,0BAA0B;IAC1B,kBAAkB;IAClB,cAAc;AAClB;;AAEA,wBAAwB;AACxB;;;IAGI,eAAe;IACf,WAAW;IACX,cAAc;IACd,eAAe;AACnB;;AAEA,mCAAmC;AACnC;IACI;;QAEI,cAAc;QACd,iBAAiB;QACjB,kBAAkB;IACtB;AACJ;;AAEA;IACI;QACI,aAAa;IACjB;;IAEA;QACI,aAAa;IACjB;AACJ","sourcesContent":["/* Transformers-specific styling additions */\n\n/* Code comparison layout */\n.code-compare {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1.5rem;\n margin: 2rem 0;\n align-items: start;\n}\n\n.code-compare .code-column {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n.code-compare .code-header {\n background: #f8f9fa;\n padding: 0.75rem 1rem;\n font-weight: 600;\n color: #495057;\n border-bottom: 1px solid #e2e8f0;\n font-size: 0.9em;\n}\n\n.code-compare pre {\n margin: 0;\n padding: 1rem;\n background: #ffffff;\n overflow-x: auto;\n font-size: 0.85em;\n line-height: 1.4;\n}\n\n.code-compare pre code {\n color: #374151;\n}\n\n/* Mobile responsiveness for code comparison */\n@media (max-width: 768px) {\n .code-compare {\n grid-template-columns: 1fr;\n gap: 1rem;\n }\n}\n\n/* Tenet styling - special highlighting for design principles */\n.tenet-list {\n margin: 3rem 0;\n}\n\n.tenet-list ol {\n counter-reset: tenet-counter -1; /* Start from 0 */\n list-style: none;\n padding-left: 0;\n display: flex;\n flex-direction: column;\n gap: 2rem;\n}\n\n.tenet-list li.tenet {\n counter-increment: tenet-counter;\n background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);\n border: 2px solid transparent;\n border-radius: 16px;\n padding: 2rem 2rem 2rem 4rem;\n margin: 0;\n position: relative;\n box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);\n transition: all 0.3s ease;\n cursor: pointer;\n}\n\n.tenet-list li.tenet:hover {\n transform: translateY(-8px) scale(1.02);\n box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);\n border-color: rgba(0, 123, 255, 0.5);\n background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);\n}\n\n/* Colorful numbering system */\n.tenet-list li.tenet:nth-child(1):before { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }\n.tenet-list li.tenet:nth-child(2):before { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }\n.tenet-list li.tenet:nth-child(3):before { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }\n.tenet-list li.tenet:nth-child(4):before { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }\n.tenet-list li.tenet:nth-child(5):before { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }\n.tenet-list li.tenet:nth-child(6):before { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }\n.tenet-list li.tenet:nth-child(7):before { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }\n.tenet-list li.tenet:nth-child(8):before { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }\n.tenet-list li.tenet:nth-child(9):before { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }\n\n.tenet-list li.tenet:before {\n content: counter(tenet-counter);\n position: absolute;\n top: -12px;\n left: -12px;\n color: white;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.2em;\n font-weight: bold;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n border: 3px solid white;\n}\n\n.tenet-list li.tenet strong {\n color: #1a202c;\n font-size: 1.1em;\n display: block;\n margin-bottom: 0.5rem;\n}\n\n.tenet-list li.tenet em {\n color: #4a5568;\n font-size: 0.95em;\n font-style: italic;\n display: block;\n margin-top: 0.75rem;\n padding: 1rem;\n background: rgba(0, 0, 0, 0.03);\n border-radius: 8px;\n border-left: 3px solid #e2e8f0;\n}\n\n.tenet-list li.tenet p {\n color: #2d3748;\n line-height: 1.6;\n margin: 0.5rem 0;\n}\n\n/* Add a subtle pulse animation for the numbers */\n@keyframes pulse-glow {\n 0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }\n 50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }\n 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }\n}\n\n.tenet-list li.tenet:hover:before {\n animation: pulse-glow 2s ease-in-out infinite;\n}\n\n/* Interactive component styling */\n.interactive-demo {\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n background: #ffffff;\n margin: 2rem 0;\n overflow: hidden;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);\n}\n\n.interactive-demo .demo-header {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n padding: 1rem 1.5rem;\n font-weight: 600;\n}\n\n.interactive-demo .demo-content {\n padding: 1.5rem;\n}\n\n.interactive-demo .demo-footer {\n background: #f8f9fa;\n padding: 1rem 1.5rem;\n border-top: 1px solid #e2e8f0;\n color: #6c757d;\n font-size: 0.9em;\n}\n\n/* Button styling for interactive elements */\n.btn-primary {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n color: white;\n padding: 0.75rem 1.5rem;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n transition: transform 0.2s, box-shadow 0.2s;\n}\n\n.btn-primary:hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);\n}\n\n.btn-primary:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n transform: none;\n box-shadow: none;\n}\n\n/* Terminal styling */\n.terminal-container {\n background: #1a202c;\n border-radius: 8px;\n padding: 1rem;\n color: #e2e8f0;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.9em;\n}\n\n.terminal-input {\n background: #2d3748;\n border: 1px solid #4a5568;\n color: #e2e8f0;\n padding: 0.5rem;\n border-radius: 4px;\n width: 100%;\n font-family: inherit;\n}\n\n.terminal-output {\n background: #0a0e1a;\n padding: 1rem;\n border-radius: 4px;\n white-space: pre-wrap;\n word-break: break-all;\n min-height: 100px;\n max-height: 300px;\n overflow-y: auto;\n}\n\n/* Attention visualization styling */\n.attention-matrix {\n font-family: monospace;\n font-size: 0.8em;\n border-collapse: collapse;\n margin: 1rem 0;\n}\n\n.attention-matrix td {\n border: 1px solid #ddd;\n padding: 4px 8px;\n text-align: center;\n min-width: 50px;\n}\n\n/* Memory chart styling */\n.memory-chart-container {\n background: #f8f9fa;\n border: 2px solid #e9ecef;\n border-radius: 8px;\n padding: 1rem;\n margin: 1rem 0;\n}\n\n/* Image styling improvements */\nimg {\n max-width: 100%;\n height: auto;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n margin: 1.5rem 0;\n}\n\n/* Table of contents styling - Fixed positioning like ultrascale */\n@media (min-width: 1200px) {\n d-article {\n overflow: visible !important;\n }\n \n d-contents {\n align-self: start !important;\n background: white !important;\n grid-column-start: 1 !important;\n grid-column-end: 4 !important;\n grid-row: auto / span 6 !important;\n justify-self: end !important;\n margin-top: 0em !important;\n padding-right: 3em !important;\n padding-left: 2em !important;\n position: -webkit-sticky !important; /* For Safari */\n position: sticky !important;\n top: 10px !important;\n overflow-y: auto !important;\n height: calc(100vh - 40px) !important;\n scrollbar-width: none !important;\n transition: max-height 0.3s ease-out !important;\n z-index: -100 !important;\n display: block !important;\n visibility: visible !important;\n }\n}\n\n@media (max-width: 1199px) {\n d-contents {\n display: none !important;\n background: white !important;\n justify-self: start !important;\n align-self: start !important;\n padding-bottom: 0.5em !important;\n margin-bottom: 1em !important;\n padding-left: 0.25em !important;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;\n overflow-y: scroll !important;\n height: calc(100vh - 40px) !important;\n scrollbar-width: none !important;\n z-index: -100 !important;\n }\n}\n\n/* Force TOC to be visible and override distill defaults */\nd-contents {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n\n/* TOC Navigation styling */\nd-contents .toc-header {\n margin-bottom: 1.5rem;\n border-bottom: 2px solid #007bff;\n padding-bottom: 0.5rem;\n}\n\nd-contents .toc-title {\n font-weight: bold;\n font-size: 1.2em;\n color: #333;\n}\n\nd-contents nav a {\n color: rgba(0, 0, 0, 0.7);\n text-decoration: none;\n border-bottom: none;\n display: block;\n padding: 0.3rem 0;\n font-size: 0.9em;\n line-height: 1.4;\n transition: color 0.2s ease;\n}\n\nd-contents nav a:hover {\n color: #007bff;\n text-decoration: none;\n}\n\nd-contents nav a.active {\n color: #007bff;\n font-weight: 600;\n}\n\nd-contents nav div {\n margin-bottom: 0.2rem;\n}\n\n/* Smooth scrollbar */\nd-contents {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 123, 255, 0.3) transparent;\n}\n\nd-contents::-webkit-scrollbar {\n width: 6px;\n}\n\nd-contents::-webkit-scrollbar-track {\n background: transparent;\n}\n\nd-contents::-webkit-scrollbar-thumb {\n background: rgba(0, 123, 255, 0.3);\n border-radius: 3px;\n}\n\nd-contents::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 123, 255, 0.5);\n}\n\n/* Custom tooltip styling for tenet links */\nd-contents nav a[title] {\n position: relative;\n cursor: help;\n}\n\nd-contents nav a[title]:hover {\n color: #667eea;\n}\n\n/* Enhanced tooltip using CSS (fallback for title attribute) */\nd-contents nav a[title]:after {\n content: attr(title);\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n background: #1a202c;\n color: white;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n font-size: 0.85em;\n white-space: normal;\n width: 300px;\n line-height: 1.4;\n z-index: 1001;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n pointer-events: none;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n}\n\nd-contents nav a[title]:before {\n content: '';\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translate(-8px, -50%);\n border: 8px solid transparent;\n border-right-color: #1a202c;\n z-index: 1002;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n}\n\nd-contents nav a[title]:hover:after,\nd-contents nav a[title]:hover:before {\n opacity: 1;\n visibility: visible;\n}\n\n/* Adjust for smaller screens */\n@media (max-width: 1400px) {\n d-contents nav a[title]:after {\n left: auto;\n right: 100%;\n margin-right: 1rem;\n width: 250px;\n }\n \n d-contents nav a[title]:before {\n left: auto;\n right: 100%;\n transform: translate(8px, -50%);\n border-right-color: transparent;\n border-left-color: #1a202c;\n }\n}\n\n/* Improve code syntax highlighting with Prism */\npre[class*=\"language-\"] {\n background: #f8f9fa !important;\n border: 1px solid #e9ecef !important;\n border-radius: 8px !important;\n padding: 1.5rem !important;\n margin: 1.5rem 0 !important;\n overflow-x: auto !important;\n font-size: 0.9em !important;\n line-height: 1.5 !important;\n}\n\ncode[class*=\"language-\"] {\n background: none !important;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace !important;\n color: #383a42 !important;\n}\n\n/* Inline code */\np code, li code {\n background: #f1f3f4 !important;\n padding: 0.2em 0.4em !important;\n border-radius: 3px !important;\n font-size: 0.9em !important;\n color: #d73a49 !important;\n}\n\n/* Distill article improvements */\nd-article {\n max-width: none;\n font-size: 18px; /* Increased from default ~16px */\n line-height: 1.7;\n}\n\nd-article > * {\n max-width: 1100px; /* Increased from 900px for more space */\n margin-left: auto;\n margin-right: auto;\n}\n\n/* Make content even wider on large screens when TOC is present */\n@media (min-width: 1400px) {\n d-article > * {\n max-width: 1300px;\n }\n}\n\n/* Improve paragraph readability */\nd-article p {\n font-size: 18px;\n line-height: 1.8;\n margin-bottom: 1.5rem;\n color: #2d3748;\n}\n\n/* Improve heading sizes */\nd-article h1 {\n font-size: 3rem;\n line-height: 1.2;\n margin: 3rem 0 2rem 0;\n color: #1a202c;\n font-weight: 700;\n}\n\nd-article h2 {\n font-size: 2.5rem;\n line-height: 1.3;\n margin: 2.5rem 0 1.5rem 0;\n color: #1a202c;\n font-weight: 650;\n}\n\nd-article h3 {\n font-size: 2rem;\n line-height: 1.4;\n margin: 2rem 0 1rem 0;\n color: #1a202c;\n font-weight: 600;\n}\n\nd-article h4 {\n font-size: 1.5rem;\n line-height: 1.4;\n margin: 1.5rem 0 1rem 0;\n color: #2d3748;\n font-weight: 600;\n}\n\n/* Improve list readability */\nd-article ul li,\nd-article ol li {\n font-size: 18px;\n line-height: 1.7;\n margin-bottom: 0.5rem;\n}\n\n/* Enhanced tenet reference styling with tooltips */\na[href^=\"#source-of-truth\"],\na[href^=\"#one-model-one-file\"],\na[href^=\"#code-is-product\"],\na[href^=\"#standardize-dont-abstract\"],\na[href^=\"#do-repeat-yourself\"],\na[href^=\"#minimal-user-api\"],\na[href^=\"#backwards-compatibility\"],\na[href^=\"#consistent-public-surface\"],\na[href^=\"#modular-toolbox\"] {\n position: relative;\n color: #667eea;\n font-weight: 600;\n text-decoration: underline;\n text-decoration-color: rgba(102, 126, 234, 0.3);\n transition: all 0.3s ease;\n cursor: help;\n}\n\na[href^=\"#source-of-truth\"]:hover,\na[href^=\"#one-model-one-file\"]:hover,\na[href^=\"#code-is-product\"]:hover,\na[href^=\"#standardize-dont-abstract\"]:hover,\na[href^=\"#do-repeat-yourself\"]:hover,\na[href^=\"#minimal-user-api\"]:hover,\na[href^=\"#backwards-compatibility\"]:hover,\na[href^=\"#consistent-public-surface\"]:hover,\na[href^=\"#modular-toolbox\"]:hover {\n color: #4c51bf;\n text-decoration-color: #4c51bf;\n background: rgba(102, 126, 234, 0.1);\n padding: 2px 4px;\n border-radius: 4px;\n}\n\n/* Tooltip content for each tenet */\na[href^=\"#source-of-truth\"]:after { content: \"We should be a source of truth for all model definitions. Model implementations should be reliable, reproducible, and faithful to the original performances.\"; }\na[href^=\"#one-model-one-file\"]:after { content: \"All inference (and most of training, loss is separate, not a part of model) logic visible, top‑to‑bottom.\"; }\na[href^=\"#code-is-product\"]:after { content: \"Optimize for reading, diffing, and tweaking, our users are power users. Variables can be explicit, full words, even several words, readability is primordial.\"; }\na[href^=\"#standardize-dont-abstract\"]:after { content: \"If it's model behavior, keep it in the file; abstractions only for generic infra.\"; }\na[href^=\"#do-repeat-yourself\"]:after { content: \"Copy when it helps users; keep successors in sync without centralizing behavior.\"; }\na[href^=\"#minimal-user-api\"]:after { content: \"Config, model, preprocessing; from_pretrained, save_pretrained, push_to_hub. We want the least amount of codepaths.\"; }\na[href^=\"#backwards-compatibility\"]:after { content: \"Evolve by additive standardization, never break public APIs.\"; }\na[href^=\"#consistent-public-surface\"]:after { content: \"Same argument names, same outputs, hidden states and attentions exposed.\"; }\na[href^=\"#modular-toolbox\"]:after { content: \"Provide tools and utilities, but don't force users into a rigid framework.\"; }\n\n/* Universal tooltip styling for tenet references */\na[href^=\"#source-of-truth\"]:after,\na[href^=\"#one-model-one-file\"]:after,\na[href^=\"#code-is-product\"]:after,\na[href^=\"#standardize-dont-abstract\"]:after,\na[href^=\"#do-repeat-yourself\"]:after,\na[href^=\"#minimal-user-api\"]:after,\na[href^=\"#backwards-compatibility\"]:after,\na[href^=\"#consistent-public-surface\"]:after,\na[href^=\"#modular-toolbox\"]:after {\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n background: #1a202c;\n color: white;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n font-size: 0.85em;\n font-weight: 400;\n white-space: normal;\n width: 320px;\n line-height: 1.4;\n z-index: 1001;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n pointer-events: none;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n margin-bottom: 8px;\n}\n\n/* Tooltip arrows */\na[href^=\"#source-of-truth\"]:before,\na[href^=\"#one-model-one-file\"]:before,\na[href^=\"#code-is-product\"]:before,\na[href^=\"#standardize-dont-abstract\"]:before,\na[href^=\"#do-repeat-yourself\"]:before,\na[href^=\"#minimal-user-api\"]:before,\na[href^=\"#backwards-compatibility\"]:before,\na[href^=\"#consistent-public-surface\"]:before,\na[href^=\"#modular-toolbox\"]:before {\n content: '';\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border: 8px solid transparent;\n border-top-color: #1a202c;\n z-index: 1002;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n}\n\n/* Show tooltips on hover */\na[href^=\"#source-of-truth\"]:hover:after,\na[href^=\"#one-model-one-file\"]:hover:after,\na[href^=\"#code-is-product\"]:hover:after,\na[href^=\"#standardize-dont-abstract\"]:hover:after,\na[href^=\"#do-repeat-yourself\"]:hover:after,\na[href^=\"#minimal-user-api\"]:hover:after,\na[href^=\"#backwards-compatibility\"]:hover:after,\na[href^=\"#consistent-public-surface\"]:hover:after,\na[href^=\"#modular-toolbox\"]:hover:after,\na[href^=\"#source-of-truth\"]:hover:before,\na[href^=\"#one-model-one-file\"]:hover:before,\na[href^=\"#code-is-product\"]:hover:before,\na[href^=\"#standardize-dont-abstract\"]:hover:before,\na[href^=\"#do-repeat-yourself\"]:hover:before,\na[href^=\"#minimal-user-api\"]:hover:before,\na[href^=\"#backwards-compatibility\"]:hover:before,\na[href^=\"#consistent-public-surface\"]:hover:before,\na[href^=\"#modular-toolbox\"]:hover:before {\n opacity: 1;\n visibility: visible;\n}\n\n/* Improve blockquote styling */\nd-article blockquote {\n font-size: 19px;\n line-height: 1.8;\n padding: 1.5rem 2rem;\n margin: 2rem 0;\n border-left: 4px solid #667eea;\n background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%);\n border-radius: 0 8px 8px 0;\n font-style: italic;\n color: #4a5568;\n}\n\n/* Full width elements */\nd-article .code-compare,\nd-article .interactive-demo,\nd-article .memory-chart-container {\n max-width: none;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n}\n\n/* Responsive design improvements */\n@media (max-width: 1200px) {\n d-article .code-compare,\n d-article .interactive-demo {\n max-width: 95%;\n margin-left: auto;\n margin-right: auto;\n }\n}\n\n@media (max-width: 768px) {\n .tenet-list li.tenet {\n padding: 1rem;\n }\n \n .interactive-demo .demo-content {\n padding: 1rem;\n }\n}"],"sourceRoot":""}]);
1858
  // Exports
1859
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
1860
 
 
1201
  counter-reset: tenet-counter -1; /* Start from 0 */
1202
  list-style: none;
1203
  padding-left: 0;
1204
+ display: grid;
1205
+ grid-template-columns: 1fr;
1206
+ gap: 2.5rem;
1207
+ max-width: 900px;
1208
+ margin: 0 auto;
1209
  }
1210
 
1211
  .tenet-list li.tenet {
1212
  counter-increment: tenet-counter;
1213
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
1214
+ border: 2px solid #e2e8f0;
1215
  border-radius: 16px;
1216
  padding: 2rem 2rem 2rem 4rem;
1217
  margin: 0;
1218
  position: relative;
1219
+ box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
1220
  transition: all 0.3s ease;
1221
  cursor: pointer;
1222
  }
 
1303
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
1304
  }
1305
 
1306
+ /* Model visualization fragment styling */
1307
+ [id*="plot-model-visualisation"] {
1308
+ margin: 1rem -2rem !important;
1309
+ width: calc(100% + 4rem) !important;
1310
+ }
1311
+
1312
  .interactive-demo .demo-header {
1313
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
1314
  color: white;
 
1862
  .interactive-demo .demo-content {
1863
  padding: 1rem;
1864
  }
1865
+ }`, "",{"version":3,"sources":["webpack://./src/transformers-custom.css"],"names":[],"mappings":"AAAA,4CAA4C;;AAE5C,2BAA2B;AAC3B;IACI,aAAa;IACb,8BAA8B;IAC9B,WAAW;IACX,cAAc;IACd,kBAAkB;AACtB;;AAEA;IACI,mBAAmB;IACnB,yBAAyB;IACzB,kBAAkB;IAClB,gBAAgB;IAChB,wCAAwC;AAC5C;;AAEA;IACI,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,cAAc;IACd,gCAAgC;IAChC,gBAAgB;AACpB;;AAEA;IACI,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;AACpB;;AAEA;IACI,cAAc;AAClB;;AAEA,8CAA8C;AAC9C;IACI;QACI,0BAA0B;QAC1B,SAAS;IACb;AACJ;;AAEA,+DAA+D;AAC/D;IACI,cAAc;AAClB;;AAEA;IACI,+BAA+B,EAAE,iBAAiB;IAClD,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,WAAW;IACX,gBAAgB;IAChB,cAAc;AAClB;;AAEA;IACI,gCAAgC;IAChC,6DAA6D;IAC7D,yBAAyB;IACzB,mBAAmB;IACnB,4BAA4B;IAC5B,SAAS;IACT,kBAAkB;IAClB,2CAA2C;IAC3C,yBAAyB;IACzB,eAAe;AACnB;;AAEA;IACI,uCAAuC;IACvC,2CAA2C;IAC3C,oCAAoC;IACpC,6DAA6D;AACjE;;AAEA,8BAA8B;AAC9B,2CAA2C,6DAA6D,EAAE;AAC1G,2CAA2C,6DAA6D,EAAE;AAC1G,2CAA2C,6DAA6D,EAAE;AAC1G,2CAA2C,6DAA6D,EAAE;AAC1G,2CAA2C,6DAA6D,EAAE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mC;AACnC;IACI;;QAEI,cAAc;QACd,iBAAiB;QACjB,kBAAkB;IACtB;AACJ;;AAEA;IACI;QACI,aAAa;IACjB;;IAEA;QACI,aAAa;IACjB;AACJ","sourcesContent":["/* Transformers-specific styling additions */\n\n/* Code comparison layout */\n.code-compare {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1.5rem;\n margin: 2rem 0;\n align-items: start;\n}\n\n.code-compare .code-column {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n.code-compare .code-header {\n background: #f8f9fa;\n padding: 0.75rem 1rem;\n font-weight: 600;\n color: #495057;\n border-bottom: 1px solid #e2e8f0;\n font-size: 0.9em;\n}\n\n.code-compare pre {\n margin: 0;\n padding: 1rem;\n background: #ffffff;\n overflow-x: auto;\n font-size: 0.85em;\n line-height: 1.4;\n}\n\n.code-compare pre code {\n color: #374151;\n}\n\n/* Mobile responsiveness for code comparison */\n@media (max-width: 768px) {\n .code-compare {\n grid-template-columns: 1fr;\n gap: 1rem;\n }\n}\n\n/* Tenet styling - special highlighting for design principles */\n.tenet-list {\n margin: 3rem 0;\n}\n\n.tenet-list ol {\n counter-reset: tenet-counter -1; /* Start from 0 */\n list-style: none;\n padding-left: 0;\n display: grid;\n grid-template-columns: 1fr;\n gap: 2.5rem;\n max-width: 900px;\n margin: 0 auto;\n}\n\n.tenet-list li.tenet {\n counter-increment: tenet-counter;\n background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);\n border: 2px solid #e2e8f0;\n border-radius: 16px;\n padding: 2rem 2rem 2rem 4rem;\n margin: 0;\n position: relative;\n box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);\n transition: all 0.3s ease;\n cursor: pointer;\n}\n\n.tenet-list li.tenet:hover {\n transform: translateY(-8px) scale(1.02);\n box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);\n border-color: rgba(0, 123, 255, 0.5);\n background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);\n}\n\n/* Colorful numbering system */\n.tenet-list li.tenet:nth-child(1):before { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }\n.tenet-list li.tenet:nth-child(2):before { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }\n.tenet-list li.tenet:nth-child(3):before { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }\n.tenet-list li.tenet:nth-child(4):before { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }\n.tenet-list li.tenet:nth-child(5):before { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }\n.tenet-list li.tenet:nth-child(6):before { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }\n.tenet-list li.tenet:nth-child(7):before { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }\n.tenet-list li.tenet:nth-child(8):before { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }\n.tenet-list li.tenet:nth-child(9):before { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }\n\n.tenet-list li.tenet:before {\n content: counter(tenet-counter);\n position: absolute;\n top: -12px;\n left: -12px;\n color: white;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.2em;\n font-weight: bold;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n border: 3px solid white;\n}\n\n.tenet-list li.tenet strong {\n color: #1a202c;\n font-size: 1.1em;\n display: block;\n margin-bottom: 0.5rem;\n}\n\n.tenet-list li.tenet em {\n color: #4a5568;\n font-size: 0.95em;\n font-style: italic;\n display: block;\n margin-top: 0.75rem;\n padding: 1rem;\n background: rgba(0, 0, 0, 0.03);\n border-radius: 8px;\n border-left: 3px solid #e2e8f0;\n}\n\n.tenet-list li.tenet p {\n color: #2d3748;\n line-height: 1.6;\n margin: 0.5rem 0;\n}\n\n/* Add a subtle pulse animation for the numbers */\n@keyframes pulse-glow {\n 0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }\n 50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }\n 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }\n}\n\n.tenet-list li.tenet:hover:before {\n animation: pulse-glow 2s ease-in-out infinite;\n}\n\n/* Interactive component styling */\n.interactive-demo {\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n background: #ffffff;\n margin: 2rem 0;\n overflow: hidden;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);\n}\n\n/* Model visualization fragment styling */\n[id*=\"plot-model-visualisation\"] {\n margin: 1rem -2rem !important;\n width: calc(100% + 4rem) !important;\n}\n\n.interactive-demo .demo-header {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n padding: 1rem 1.5rem;\n font-weight: 600;\n}\n\n.interactive-demo .demo-content {\n padding: 1.5rem;\n}\n\n.interactive-demo .demo-footer {\n background: #f8f9fa;\n padding: 1rem 1.5rem;\n border-top: 1px solid #e2e8f0;\n color: #6c757d;\n font-size: 0.9em;\n}\n\n/* Button styling for interactive elements */\n.btn-primary {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n color: white;\n padding: 0.75rem 1.5rem;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n transition: transform 0.2s, box-shadow 0.2s;\n}\n\n.btn-primary:hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);\n}\n\n.btn-primary:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n transform: none;\n box-shadow: none;\n}\n\n/* Terminal styling */\n.terminal-container {\n background: #1a202c;\n border-radius: 8px;\n padding: 1rem;\n color: #e2e8f0;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 0.9em;\n}\n\n.terminal-input {\n background: #2d3748;\n border: 1px solid #4a5568;\n color: #e2e8f0;\n padding: 0.5rem;\n border-radius: 4px;\n width: 100%;\n font-family: inherit;\n}\n\n.terminal-output {\n background: #0a0e1a;\n padding: 1rem;\n border-radius: 4px;\n white-space: pre-wrap;\n word-break: break-all;\n min-height: 100px;\n max-height: 300px;\n overflow-y: auto;\n}\n\n/* Attention visualization styling */\n.attention-matrix {\n font-family: monospace;\n font-size: 0.8em;\n border-collapse: collapse;\n margin: 1rem 0;\n}\n\n.attention-matrix td {\n border: 1px solid #ddd;\n padding: 4px 8px;\n text-align: center;\n min-width: 50px;\n}\n\n/* Memory chart styling */\n.memory-chart-container {\n background: #f8f9fa;\n border: 2px solid #e9ecef;\n border-radius: 8px;\n padding: 1rem;\n margin: 1rem 0;\n}\n\n/* Image styling improvements */\nimg {\n max-width: 100%;\n height: auto;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n margin: 1.5rem 0;\n}\n\n/* Table of contents styling - Fixed positioning like ultrascale */\n@media (min-width: 1200px) {\n d-article {\n overflow: visible !important;\n }\n \n d-contents {\n align-self: start !important;\n background: white !important;\n grid-column-start: 1 !important;\n grid-column-end: 4 !important;\n grid-row: auto / span 6 !important;\n justify-self: end !important;\n margin-top: 0em !important;\n padding-right: 3em !important;\n padding-left: 2em !important;\n position: -webkit-sticky !important; /* For Safari */\n position: sticky !important;\n top: 10px !important;\n overflow-y: auto !important;\n height: calc(100vh - 40px) !important;\n scrollbar-width: none !important;\n transition: max-height 0.3s ease-out !important;\n z-index: -100 !important;\n display: block !important;\n visibility: visible !important;\n }\n}\n\n@media (max-width: 1199px) {\n d-contents {\n display: none !important;\n background: white !important;\n justify-self: start !important;\n align-self: start !important;\n padding-bottom: 0.5em !important;\n margin-bottom: 1em !important;\n padding-left: 0.25em !important;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;\n overflow-y: scroll !important;\n height: calc(100vh - 40px) !important;\n scrollbar-width: none !important;\n z-index: -100 !important;\n }\n}\n\n/* Force TOC to be visible and override distill defaults */\nd-contents {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n\n/* TOC Navigation styling */\nd-contents .toc-header {\n margin-bottom: 1.5rem;\n border-bottom: 2px solid #007bff;\n padding-bottom: 0.5rem;\n}\n\nd-contents .toc-title {\n font-weight: bold;\n font-size: 1.2em;\n color: #333;\n}\n\nd-contents nav a {\n color: rgba(0, 0, 0, 0.7);\n text-decoration: none;\n border-bottom: none;\n display: block;\n padding: 0.3rem 0;\n font-size: 0.9em;\n line-height: 1.4;\n transition: color 0.2s ease;\n}\n\nd-contents nav a:hover {\n color: #007bff;\n text-decoration: none;\n}\n\nd-contents nav a.active {\n color: #007bff;\n font-weight: 600;\n}\n\nd-contents nav div {\n margin-bottom: 0.2rem;\n}\n\n/* Smooth scrollbar */\nd-contents {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 123, 255, 0.3) transparent;\n}\n\nd-contents::-webkit-scrollbar {\n width: 6px;\n}\n\nd-contents::-webkit-scrollbar-track {\n background: transparent;\n}\n\nd-contents::-webkit-scrollbar-thumb {\n background: rgba(0, 123, 255, 0.3);\n border-radius: 3px;\n}\n\nd-contents::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 123, 255, 0.5);\n}\n\n/* Custom tooltip styling for tenet links */\nd-contents nav a[title] {\n position: relative;\n cursor: help;\n}\n\nd-contents nav a[title]:hover {\n color: #667eea;\n}\n\n/* Enhanced tooltip using CSS (fallback for title attribute) */\nd-contents nav a[title]:after {\n content: attr(title);\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n background: #1a202c;\n color: white;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n font-size: 0.85em;\n white-space: normal;\n width: 300px;\n line-height: 1.4;\n z-index: 1001;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n pointer-events: none;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n}\n\nd-contents nav a[title]:before {\n content: '';\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translate(-8px, -50%);\n border: 8px solid transparent;\n border-right-color: #1a202c;\n z-index: 1002;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n}\n\nd-contents nav a[title]:hover:after,\nd-contents nav a[title]:hover:before {\n opacity: 1;\n visibility: visible;\n}\n\n/* Adjust for smaller screens */\n@media (max-width: 1400px) {\n d-contents nav a[title]:after {\n left: auto;\n right: 100%;\n margin-right: 1rem;\n width: 250px;\n }\n \n d-contents nav a[title]:before {\n left: auto;\n right: 100%;\n transform: translate(8px, -50%);\n border-right-color: transparent;\n border-left-color: #1a202c;\n }\n}\n\n/* Improve code syntax highlighting with Prism */\npre[class*=\"language-\"] {\n background: #f8f9fa !important;\n border: 1px solid #e9ecef !important;\n border-radius: 8px !important;\n padding: 1.5rem !important;\n margin: 1.5rem 0 !important;\n overflow-x: auto !important;\n font-size: 0.9em !important;\n line-height: 1.5 !important;\n}\n\ncode[class*=\"language-\"] {\n background: none !important;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace !important;\n color: #383a42 !important;\n}\n\n/* Inline code */\np code, li code {\n background: #f1f3f4 !important;\n padding: 0.2em 0.4em !important;\n border-radius: 3px !important;\n font-size: 0.9em !important;\n color: #d73a49 !important;\n}\n\n/* Distill article improvements */\nd-article {\n max-width: none;\n font-size: 18px; /* Increased from default ~16px */\n line-height: 1.7;\n}\n\nd-article > * {\n max-width: 1100px; /* Increased from 900px for more space */\n margin-left: auto;\n margin-right: auto;\n}\n\n/* Make content even wider on large screens when TOC is present */\n@media (min-width: 1400px) {\n d-article > * {\n max-width: 1300px;\n }\n}\n\n/* Improve paragraph readability */\nd-article p {\n font-size: 18px;\n line-height: 1.8;\n margin-bottom: 1.5rem;\n color: #2d3748;\n}\n\n/* Improve heading sizes */\nd-article h1 {\n font-size: 3rem;\n line-height: 1.2;\n margin: 3rem 0 2rem 0;\n color: #1a202c;\n font-weight: 700;\n}\n\nd-article h2 {\n font-size: 2.5rem;\n line-height: 1.3;\n margin: 2.5rem 0 1.5rem 0;\n color: #1a202c;\n font-weight: 650;\n}\n\nd-article h3 {\n font-size: 2rem;\n line-height: 1.4;\n margin: 2rem 0 1rem 0;\n color: #1a202c;\n font-weight: 600;\n}\n\nd-article h4 {\n font-size: 1.5rem;\n line-height: 1.4;\n margin: 1.5rem 0 1rem 0;\n color: #2d3748;\n font-weight: 600;\n}\n\n/* Improve list readability */\nd-article ul li,\nd-article ol li {\n font-size: 18px;\n line-height: 1.7;\n margin-bottom: 0.5rem;\n}\n\n/* Enhanced tenet reference styling with tooltips */\na[href^=\"#source-of-truth\"],\na[href^=\"#one-model-one-file\"],\na[href^=\"#code-is-product\"],\na[href^=\"#standardize-dont-abstract\"],\na[href^=\"#do-repeat-yourself\"],\na[href^=\"#minimal-user-api\"],\na[href^=\"#backwards-compatibility\"],\na[href^=\"#consistent-public-surface\"],\na[href^=\"#modular-toolbox\"] {\n position: relative;\n color: #667eea;\n font-weight: 600;\n text-decoration: underline;\n text-decoration-color: rgba(102, 126, 234, 0.3);\n transition: all 0.3s ease;\n cursor: help;\n}\n\na[href^=\"#source-of-truth\"]:hover,\na[href^=\"#one-model-one-file\"]:hover,\na[href^=\"#code-is-product\"]:hover,\na[href^=\"#standardize-dont-abstract\"]:hover,\na[href^=\"#do-repeat-yourself\"]:hover,\na[href^=\"#minimal-user-api\"]:hover,\na[href^=\"#backwards-compatibility\"]:hover,\na[href^=\"#consistent-public-surface\"]:hover,\na[href^=\"#modular-toolbox\"]:hover {\n color: #4c51bf;\n text-decoration-color: #4c51bf;\n background: rgba(102, 126, 234, 0.1);\n padding: 2px 4px;\n border-radius: 4px;\n}\n\n/* Tooltip content for each tenet */\na[href^=\"#source-of-truth\"]:after { content: \"We should be a source of truth for all model definitions. Model implementations should be reliable, reproducible, and faithful to the original performances.\"; }\na[href^=\"#one-model-one-file\"]:after { content: \"All inference (and most of training, loss is separate, not a part of model) logic visible, top‑to‑bottom.\"; }\na[href^=\"#code-is-product\"]:after { content: \"Optimize for reading, diffing, and tweaking, our users are power users. Variables can be explicit, full words, even several words, readability is primordial.\"; }\na[href^=\"#standardize-dont-abstract\"]:after { content: \"If it's model behavior, keep it in the file; abstractions only for generic infra.\"; }\na[href^=\"#do-repeat-yourself\"]:after { content: \"Copy when it helps users; keep successors in sync without centralizing behavior.\"; }\na[href^=\"#minimal-user-api\"]:after { content: \"Config, model, preprocessing; from_pretrained, save_pretrained, push_to_hub. We want the least amount of codepaths.\"; }\na[href^=\"#backwards-compatibility\"]:after { content: \"Evolve by additive standardization, never break public APIs.\"; }\na[href^=\"#consistent-public-surface\"]:after { content: \"Same argument names, same outputs, hidden states and attentions exposed.\"; }\na[href^=\"#modular-toolbox\"]:after { content: \"Provide tools and utilities, but don't force users into a rigid framework.\"; }\n\n/* Universal tooltip styling for tenet references */\na[href^=\"#source-of-truth\"]:after,\na[href^=\"#one-model-one-file\"]:after,\na[href^=\"#code-is-product\"]:after,\na[href^=\"#standardize-dont-abstract\"]:after,\na[href^=\"#do-repeat-yourself\"]:after,\na[href^=\"#minimal-user-api\"]:after,\na[href^=\"#backwards-compatibility\"]:after,\na[href^=\"#consistent-public-surface\"]:after,\na[href^=\"#modular-toolbox\"]:after {\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n background: #1a202c;\n color: white;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n font-size: 0.85em;\n font-weight: 400;\n white-space: normal;\n width: 320px;\n line-height: 1.4;\n z-index: 1001;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n pointer-events: none;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n margin-bottom: 8px;\n}\n\n/* Tooltip arrows */\na[href^=\"#source-of-truth\"]:before,\na[href^=\"#one-model-one-file\"]:before,\na[href^=\"#code-is-product\"]:before,\na[href^=\"#standardize-dont-abstract\"]:before,\na[href^=\"#do-repeat-yourself\"]:before,\na[href^=\"#minimal-user-api\"]:before,\na[href^=\"#backwards-compatibility\"]:before,\na[href^=\"#consistent-public-surface\"]:before,\na[href^=\"#modular-toolbox\"]:before {\n content: '';\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border: 8px solid transparent;\n border-top-color: #1a202c;\n z-index: 1002;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n}\n\n/* Show tooltips on hover */\na[href^=\"#source-of-truth\"]:hover:after,\na[href^=\"#one-model-one-file\"]:hover:after,\na[href^=\"#code-is-product\"]:hover:after,\na[href^=\"#standardize-dont-abstract\"]:hover:after,\na[href^=\"#do-repeat-yourself\"]:hover:after,\na[href^=\"#minimal-user-api\"]:hover:after,\na[href^=\"#backwards-compatibility\"]:hover:after,\na[href^=\"#consistent-public-surface\"]:hover:after,\na[href^=\"#modular-toolbox\"]:hover:after,\na[href^=\"#source-of-truth\"]:hover:before,\na[href^=\"#one-model-one-file\"]:hover:before,\na[href^=\"#code-is-product\"]:hover:before,\na[href^=\"#standardize-dont-abstract\"]:hover:before,\na[href^=\"#do-repeat-yourself\"]:hover:before,\na[href^=\"#minimal-user-api\"]:hover:before,\na[href^=\"#backwards-compatibility\"]:hover:before,\na[href^=\"#consistent-public-surface\"]:hover:before,\na[href^=\"#modular-toolbox\"]:hover:before {\n opacity: 1;\n visibility: visible;\n}\n\n/* Improve blockquote styling */\nd-article blockquote {\n font-size: 19px;\n line-height: 1.8;\n padding: 1.5rem 2rem;\n margin: 2rem 0;\n border-left: 4px solid #667eea;\n background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%);\n border-radius: 0 8px 8px 0;\n font-style: italic;\n color: #4a5568;\n}\n\n/* Full width elements */\nd-article .code-compare,\nd-article .interactive-demo,\nd-article .memory-chart-container {\n max-width: none;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n}\n\n/* Responsive design improvements */\n@media (max-width: 1200px) {\n d-article .code-compare,\n d-article .interactive-demo {\n max-width: 95%;\n margin-left: auto;\n margin-right: auto;\n }\n}\n\n@media (max-width: 768px) {\n .tenet-list li.tenet {\n padding: 1rem;\n }\n \n .interactive-demo .demo-content {\n padding: 1rem;\n }\n}"],"sourceRoot":""}]);
1866
  // Exports
1867
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
1868
 
dist/main.bundle.js.map CHANGED
The diff for this file is too large to render. See raw diff
 
dist/static/fast_image_processors.png ADDED

Git LFS Details

  • SHA256: fc95ff78646cc2ab036d486fb212b40c6fd07206c8506c92b0659c16dd766d31
  • Pointer size: 131 Bytes
  • Size of remote file: 127 kB
src/fragments/attention-visualizer.html CHANGED
@@ -1,102 +1,45 @@
1
- <div style="border: 1px solid #e2e8f0; border-radius: 8px; background: white; margin: 1.5rem 0;">
2
- <div style="padding: 1rem; border-bottom: 1px solid #e2e8f0; background: #f8f9fa;">
3
- <h4 style="margin: 0 0 0.5rem 0; color: #495057;">πŸ” Attention Mask Visualizer</h4>
4
- <p style="margin: 0; font-size: 0.9em; color: #6c757d;">
5
- Visualize attention patterns in transformer models. This helps debug attention mask issues.
6
- </p>
 
7
  </div>
8
-
9
- <div style="padding: 1rem;">
10
- <div style="display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; margin-bottom: 1rem;">
11
- <div>
12
- <label style="display: block; font-weight: 600; margin-bottom: 0.5rem; color: #374151;">Model:</label>
13
- <select id="model-select" style="width: 100%; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; background: white;">
14
- <option value="openai-community/gpt2">openai-community/gpt2</option>
15
- <option value="google/gemma-2-2b">google/gemma-2-2b</option>
16
- <option value="microsoft/DialoGPT-small">microsoft/DialoGPT-small</option>
17
- </select>
18
- </div>
19
-
20
- <div>
21
- <label style="display: block; font-weight: 600; margin-bottom: 0.5rem; color: #374151;">Action:</label>
22
- <button id="visualize-btn" style="padding: 0.5rem 1rem; background: #3b82f6; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 500;">
23
- πŸš€ Visualize
24
- </button>
25
- </div>
26
- </div>
27
-
28
- <div style="margin-bottom: 1rem;">
29
- <label style="display: block; font-weight: 600; margin-bottom: 0.5rem; color: #374151;">Prompt:</label>
30
- <textarea id="prompt-input"
31
- style="width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; resize: vertical; font-family: monospace; font-size: 0.9em;"
32
- rows="3"
33
- placeholder="You are an assistant. Make sure you print me."></textarea>
34
- </div>
35
-
36
- <div id="attention-output" style="min-height: 200px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; padding: 1rem;">
37
- <div style="text-align: center; color: #6c757d; font-style: italic;">
38
- Click "Visualize" to generate attention visualization
39
- </div>
40
- </div>
41
- </div>
42
-
43
- <div style="padding: 1rem; border-top: 1px solid #e2e8f0; background: #f8f9fa; font-size: 0.9em; color: #6c757d;">
44
- <strong>Note:</strong> This is a demonstration. In the original Gradio app, this would use GPU processing with ZeroGPU
45
- to generate real attention visualizations from transformer models.
46
- </div>
47
- </div>
48
 
49
- <script>
50
- document.addEventListener('DOMContentLoaded', function() {
51
- const modelSelect = document.getElementById('model-select');
52
- const promptInput = document.getElementById('prompt-input');
53
- const visualizeBtn = document.getElementById('visualize-btn');
54
- const output = document.getElementById('attention-output');
55
-
56
- // Set default prompt
57
- promptInput.value = "You are an assistant. Make sure you print me.";
58
-
59
- visualizeBtn.addEventListener('click', function() {
60
- const model = modelSelect.value;
61
- const prompt = promptInput.value.trim();
62
-
63
- if (!prompt) {
64
- output.innerHTML = '<div style="color: #e53e3e;">Please enter a prompt</div>';
65
- return;
66
- }
67
-
68
- // Show loading state
69
- visualizeBtn.disabled = true;
70
- visualizeBtn.textContent = 'Processing...';
71
- output.innerHTML = '<div style="text-align: center; color: #6c757d;"><em>Generating attention visualization...</em></div>';
72
-
73
- // Simulate processing time
74
- setTimeout(() => {
75
- // Generate mock attention visualization
76
- const tokens = prompt.split(' ').slice(0, 8); // Limit tokens for demo
77
- let html = '<div style="margin-bottom: 1rem;"><strong>Model:</strong> ' + model + '</div>';
78
- html += '<div style="margin-bottom: 1rem;"><strong>Tokens:</strong> ' + tokens.join(' β€’ ') + '</div>';
79
- html += '<div><strong>Attention Matrix (Layer 0, Head 0):</strong></div>';
80
- html += '<table style="margin-top: 0.5rem; border-collapse: collapse; font-family: monospace; font-size: 0.8em;">';
81
-
82
- // Generate attention matrix visualization
83
- for (let i = 0; i < tokens.length; i++) {
84
- html += '<tr>';
85
- for (let j = 0; j < tokens.length; j++) {
86
- const attention = Math.random();
87
- const opacity = attention;
88
- const color = `rgba(59, 130, 246, ${opacity})`;
89
- html += `<td style="border: 1px solid #ddd; padding: 4px; background: ${color}; text-align: center; min-width: 40px;">${attention.toFixed(2)}</td>`;
90
- }
91
- html += '</tr>';
92
- }
93
- html += '</table>';
94
- html += '<div style="margin-top: 1rem; font-size: 0.9em; color: #6c757d;"><em>Darker blue = higher attention weight</em></div>';
95
-
96
- output.innerHTML = html;
97
- visualizeBtn.disabled = false;
98
- visualizeBtn.textContent = 'πŸš€ Visualize';
99
- }, 2000);
100
- });
101
- });
102
- </script>
 
1
+ <!-- Minimal HTML fragment: terminal-style ASCII attention masks -->
2
+ <div style="max-width: 940px; margin: 16px 0; border:1px solid #2a2f3a; border-radius:8px; background:#0b0f19; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; color:#e5e7eb;">
3
+ <div style="display:flex; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid #1f2430; background:#111827; border-top-left-radius:8px; border-top-right-radius:8px;">
4
+ <span style="width:10px; height:10px; background:#ef4444; border-radius:50%; display:inline-block;"></span>
5
+ <span style="width:10px; height:10px; background:#f59e0b; border-radius:50%; display:inline-block;"></span>
6
+ <span style="width:10px; height:10px; background:#22c55e; border-radius:50%; display:inline-block;"></span>
7
+ <span style="margin-left:8px; font-size:12px; color:#9ca3af;">attention-mask-visualizer</span>
8
  </div>
9
+ <div style="padding:12px 14px; overflow:auto; font-size:12.5px; line-height:1.4;">
10
+ <pre style="margin:0; white-space:pre; tab-size:2;">
11
+ ATTN MASK β€” GPT-2 (causal)
12
+ Tokens: [The, cat, sat, on, the, mat]
13
+ Legend: x = can attend, . = masked (future)
14
+
15
+ The cat sat on the mat
16
+ The x
17
+ cat x x
18
+ sat x x x
19
+ on x x x x
20
+ the x x x x x
21
+ mat x x x x x x
22
+
23
+
24
+ ATTN MASK β€” PaliGemma-style (bidirectional prefix + causal suffix)
25
+ Prefix: [&lt;i0&gt; &lt;i1&gt; &lt;i2&gt; &lt;i3&gt; &lt;i4&gt; What is this]
26
+ Suffix: [A great duck]
27
+ Legend: βœ“ = can attend, βœ— = cannot
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ &lt;i0&gt;&lt;i1&gt;&lt;i2&gt;&lt;i3&gt;&lt;i4&gt; What is this | A great duck
30
+ &lt;i0&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
31
+ &lt;i1&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
32
+ &lt;i2&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
33
+ &lt;i3&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
34
+ &lt;i4&gt; βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
35
+ What βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
36
+ is βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
37
+ this βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ— βœ—
38
+ --------------------------------------------------------------------
39
+ A βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ— βœ—
40
+ great βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ—
41
+ duck βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“ βœ“
42
+ </pre>
43
+ </div>
44
+ </div>
45
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/fragments/dependency-graph.html CHANGED
@@ -1,14 +1,6 @@
1
- <script type="module" src="https://gradio.s3-us-west-2.amazonaws.com/4.0/gradio.js"></script>
2
-
3
- <section id="modular-explorer" data-no-toc style="margin:2rem 0">
4
- <h2 style="margin:0 0 .5rem 0">πŸ” Modular-candidate explorer (live)</h2>
5
- <div style="position:relative; padding-top:62.5%; border:1px solid rgba(0,0,0,.08); border-radius:12px; overflow:hidden; background:#fff">
6
- <gradio-app
7
- src="https://molbap-transformers-modular-refactor.hf.space?tab=graph"
8
- style="position:absolute; inset:0; width:100%; height:100%; border:0"
9
- ></gradio-app>
10
- </div>
11
- <p class="figcaption" style="margin:.6rem 0 0 0">
12
- Opens full app: <a href="https://huggingface.co/spaces/Molbap/transformers-modular-refactor" target="_blank" rel="noopener">Space page</a>.
13
- </p>
14
- </section>
 
1
+ <iframe
2
+ src="https://molbap-dependencies-1.hf.space"
3
+ style="width:100%; height:680px; border:0"
4
+ allow="clipboard-read; clipboard-write; fullscreen"
5
+ referrerpolicy="no-referrer-when-downgrade"
6
+ ></iframe>
 
 
 
 
 
 
 
 
src/fragments/loc-growth.html CHANGED
@@ -1,267 +1,6 @@
1
- <style>
2
- .loc-growth-container {
3
- margin: 2rem 0;
4
- border: 1px solid #e5e7eb;
5
- border-radius: 12px;
6
- overflow: hidden;
7
- background: white;
8
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
9
- }
10
-
11
- .loc-growth-header {
12
- background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
13
- color: white;
14
- padding: 1rem 1.5rem;
15
- }
16
-
17
- .loc-growth-header h3 {
18
- margin: 0;
19
- font-size: 1.25rem;
20
- font-weight: 600;
21
- }
22
-
23
- .loc-growth-controls {
24
- padding: 1rem 1.5rem;
25
- background: #f8f9fa;
26
- border-bottom: 1px solid #e5e7eb;
27
- display: flex;
28
- gap: 1rem;
29
- align-items: center;
30
- flex-wrap: wrap;
31
- }
32
-
33
- .loc-growth-control {
34
- display: flex;
35
- align-items: center;
36
- gap: 0.5rem;
37
- }
38
-
39
- .loc-growth-control label {
40
- font-size: 0.875rem;
41
- font-weight: 500;
42
- color: #374151;
43
- }
44
-
45
- .loc-growth-control select {
46
- padding: 0.5rem;
47
- border: 1px solid #d1d5db;
48
- border-radius: 6px;
49
- background: white;
50
- font-size: 0.875rem;
51
- }
52
-
53
- .loc-growth-control input[type="checkbox"] {
54
- width: 16px;
55
- height: 16px;
56
- accent-color: #4facfe;
57
- }
58
-
59
- .loc-growth-iframe {
60
- width: 100%;
61
- height: 450px;
62
- border: none;
63
- background: white;
64
- }
65
-
66
- .loc-growth-footer {
67
- padding: 1rem 1.5rem;
68
- background: #f8f9fa;
69
- font-size: 0.875rem;
70
- color: #6b7280;
71
- line-height: 1.5;
72
- }
73
- </style>
74
-
75
- <div class="loc-growth-container">
76
- <div class="loc-growth-header">
77
- <h3 data-no-toc">πŸ“ˆ Lines of Code Growth Analysis</h3>
78
- </div>
79
-
80
- <div class="loc-growth-controls">
81
- <div class="loc-growth-control">
82
- <label for="similarity-metric">Similarity metric:</label>
83
- <select id="similarity-metric">
84
- <option value="jaccard">Jaccard</option>
85
- <option value="embedding">Embedding</option>
86
- </select>
87
- </div>
88
-
89
- <div class="loc-growth-control">
90
- <input type="checkbox" id="loc-multimodal-only">
91
- <label for="loc-multimodal-only">Only multimodal models</label>
92
- </div>
93
-
94
- <div class="loc-growth-control">
95
- <button id="update-loc" style="padding: 0.5rem 1rem; background: #4facfe; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.875rem;">
96
- Update Chart
97
- </button>
98
- </div>
99
- </div>
100
-
101
- <iframe id="loc-frame" class="loc-growth-iframe" src="about:blank"></iframe>
102
-
103
- <div class="loc-growth-footer">
104
- <strong>Lines of code growth</strong> showing how the codebase has evolved over time.
105
- This analysis reveals the impact of modularization efforts on code duplication and maintainability.
106
- Different similarity metrics provide insights into various aspects of code relationships.
107
- </div>
108
- </div>
109
-
110
- <script>
111
- (function() {
112
- const metricSelect = document.getElementById('similarity-metric');
113
- const multimodalCheckbox = document.getElementById('loc-multimodal-only');
114
- const updateButton = document.getElementById('update-loc');
115
- const locFrame = document.getElementById('loc-frame');
116
-
117
- function updateLOC() {
118
- const metric = metricSelect.value;
119
- const multimodal = multimodalCheckbox.checked;
120
-
121
- updateButton.textContent = 'Loading...';
122
- updateButton.disabled = true;
123
-
124
- // Create a LOC growth visualization
125
- const locHtml = `
126
- <!DOCTYPE html>
127
- <html>
128
- <head>
129
- <script src="https://d3js.org/d3.v7.min.js"></script>
130
- <style>
131
- body { margin: 0; padding: 20px; font-family: system-ui, sans-serif; background: #fafafa; }
132
- .loading { text-align: center; padding: 50px; color: #6b7280; }
133
- .chart-container { background: white; border-radius: 8px; padding: 20px; }
134
- .chart-title { text-align: center; font-weight: 600; margin-bottom: 20px; color: #374151; }
135
- .axis { font-size: 12px; }
136
- .line { fill: none; stroke-width: 2px; }
137
- .line.total { stroke: #4facfe; }
138
- .line.modular { stroke: #10b981; }
139
- .line.non-modular { stroke: #f59e0b; }
140
- .legend { font-size: 12px; }
141
- .legend-item { margin-right: 20px; }
142
- .legend-color { width: 12px; height: 12px; display: inline-block; margin-right: 5px; }
143
- .tooltip {
144
- position: absolute;
145
- background: rgba(0,0,0,0.8);
146
- color: white;
147
- padding: 8px;
148
- border-radius: 4px;
149
- font-size: 12px;
150
- pointer-events: none;
151
- opacity: 0;
152
- }
153
- </style>
154
- </head>
155
- <body>
156
- <div class="loading">Loading LOC growth analysis using ${metric} similarity${multimodal ? ' (multimodal only)' : ''}...</div>
157
- <div class="chart-container" id="chart-content" style="display: none;">
158
- <div class="chart-title">Lines of Code Growth Over Time</div>
159
- <div class="legend" style="text-align: center; margin-bottom: 20px;">
160
- <span class="legend-item">
161
- <span class="legend-color" style="background: #4facfe;"></span>Total LOC
162
- </span>
163
- <span class="legend-item">
164
- <span class="legend-color" style="background: #10b981;"></span>Modular Models
165
- </span>
166
- <span class="legend-item">
167
- <span class="legend-color" style="background: #f59e0b;"></span>Non-Modular Models
168
- </span>
169
- </div>
170
- <svg id="loc-chart" width="100%" height="300"></svg>
171
- <div style="margin-top: 20px; font-size: 0.875rem; color: #6b7280; text-align: center;">
172
- <p><strong>Key Insights:</strong></p>
173
- <p>β€’ Modularization reduces code duplication and maintenance overhead</p>
174
- <p>β€’ The ${metric} metric shows ${multimodal ? 'multimodal' : 'all'} model relationships</p>
175
- <p>β€’ Growth trends indicate the effectiveness of the modular approach</p>
176
- </div>
177
- </div>
178
- <div class="tooltip"></div>
179
- <script>
180
- // Sample LOC growth data
181
- const sampleLOCData = [
182
- { date: '2022-01', total: 125000, modular: 15000, nonModular: 110000 },
183
- { date: '2022-06', total: 180000, modular: 35000, nonModular: 145000 },
184
- { date: '2023-01', total: 220000, modular: 65000, nonModular: 155000 },
185
- { date: '2023-06', total: 245000, modular: 95000, nonModular: 150000 },
186
- { date: '2024-01', total: 260000, modular: 125000, nonModular: 135000 },
187
- { date: '2024-06', total: 270000, modular: 155000, nonModular: 115000 }
188
- ];
189
-
190
- setTimeout(() => {
191
- const loadingDiv = document.querySelector('.loading');
192
- const chartDiv = document.getElementById('chart-content');
193
-
194
- // Simple chart rendering
195
- const svg = d3.select('#loc-chart');
196
- const margin = {top: 20, right: 30, bottom: 40, left: 60};
197
- const width = 500 - margin.left - margin.right;
198
- const height = 300 - margin.top - margin.bottom;
199
-
200
- const parseDate = d3.timeParse('%Y-%m');
201
- const data = sampleLOCData.map(d => ({
202
- ...d,
203
- date: parseDate(d.date)
204
- }));
205
-
206
- const x = d3.scaleTime()
207
- .domain(d3.extent(data, d => d.date))
208
- .range([0, width]);
209
-
210
- const y = d3.scaleLinear()
211
- .domain([0, d3.max(data, d => d.total)])
212
- .range([height, 0]);
213
-
214
- const g = svg.append('g')
215
- .attr('transform', \`translate(\${margin.left},\${margin.top})\`);
216
-
217
- // Add axes
218
- g.append('g')
219
- .attr('transform', \`translate(0,\${height})\`)
220
- .call(d3.axisBottom(x).tickFormat(d3.timeFormat('%Y-%m')));
221
-
222
- g.append('g')
223
- .call(d3.axisLeft(y).tickFormat(d => (d/1000) + 'k'));
224
-
225
- // Add lines
226
- const line = d3.line()
227
- .x(d => x(d.date))
228
- .y(d => y(d.value));
229
-
230
- const lines = [
231
- { key: 'total', color: '#4facfe', data: data.map(d => ({date: d.date, value: d.total})) },
232
- { key: 'modular', color: '#10b981', data: data.map(d => ({date: d.date, value: d.modular})) },
233
- { key: 'nonModular', color: '#f59e0b', data: data.map(d => ({date: d.date, value: d.nonModular})) }
234
- ];
235
-
236
- lines.forEach(lineData => {
237
- g.append('path')
238
- .datum(lineData.data)
239
- .attr('class', 'line')
240
- .attr('d', line)
241
- .style('stroke', lineData.color);
242
- });
243
-
244
- loadingDiv.style.display = 'none';
245
- chartDiv.style.display = 'block';
246
- }, 1000);
247
- </script>
248
- </body>
249
- </html>`;
250
-
251
- // Encode the HTML for the iframe
252
- const encodedHtml = 'data:text/html;charset=utf-8,' + encodeURIComponent(locHtml);
253
- locFrame.src = encodedHtml;
254
-
255
- setTimeout(() => {
256
- updateButton.textContent = 'Update Chart';
257
- updateButton.disabled = false;
258
- }, 1000);
259
- }
260
-
261
- // Initial load
262
- updateLOC();
263
-
264
- // Update on button click
265
- updateButton.addEventListener('click', updateLOC);
266
- })();
267
- </script>
 
1
+ <iframe
2
+ src="https://molbap-loc-1.hf.space"
3
+ style="width:100%; height:680px; border:0"
4
+ allow="clipboard-read; clipboard-write; fullscreen"
5
+ referrerpolicy="no-referrer-when-downgrade"
6
+ ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/fragments/model-timeline.html CHANGED
@@ -1,254 +1,6 @@
1
- <style>
2
- .model-timeline-container {
3
- margin: 2rem 0;
4
- border: 1px solid #e5e7eb;
5
- border-radius: 12px;
6
- overflow: hidden;
7
- background: white;
8
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
9
- }
10
-
11
- .model-timeline-header {
12
- background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
13
- color: white;
14
- padding: 1rem 1.5rem;
15
- }
16
-
17
- .model-timeline-header h3 {
18
- margin: 0;
19
- font-size: 1.25rem;
20
- font-weight: 600;
21
- }
22
-
23
- .model-timeline-controls {
24
- padding: 1rem 1.5rem;
25
- background: #f8f9fa;
26
- border-bottom: 1px solid #e5e7eb;
27
- display: flex;
28
- gap: 1rem;
29
- align-items: center;
30
- flex-wrap: wrap;
31
- }
32
-
33
- .model-timeline-control {
34
- display: flex;
35
- align-items: center;
36
- gap: 0.5rem;
37
- }
38
-
39
- .model-timeline-control label {
40
- font-size: 0.875rem;
41
- font-weight: 500;
42
- color: #374151;
43
- }
44
-
45
- .model-timeline-control input[type="range"] {
46
- width: 120px;
47
- height: 4px;
48
- background: #e5e7eb;
49
- border-radius: 2px;
50
- outline: none;
51
- -webkit-appearance: none;
52
- }
53
-
54
- .model-timeline-control input[type="range"]::-webkit-slider-thumb {
55
- -webkit-appearance: none;
56
- width: 16px;
57
- height: 16px;
58
- background: #f5576c;
59
- border-radius: 50%;
60
- cursor: pointer;
61
- }
62
-
63
- .model-timeline-control input[type="checkbox"] {
64
- width: 16px;
65
- height: 16px;
66
- accent-color: #f5576c;
67
- }
68
-
69
- .model-timeline-control .threshold-value {
70
- font-weight: 600;
71
- color: #f5576c;
72
- min-width: 40px;
73
- }
74
-
75
- .model-timeline-iframe {
76
- width: 100%;
77
- height: 500px;
78
- border: none;
79
- background: white;
80
- }
81
-
82
- .model-timeline-footer {
83
- padding: 1rem 1.5rem;
84
- background: #f8f9fa;
85
- font-size: 0.875rem;
86
- color: #6b7280;
87
- line-height: 1.5;
88
- }
89
- </style>
90
-
91
- <div class="model-timeline-container">
92
- <div class="model-timeline-header">
93
- <h3 data-no-toc">πŸ“… Model Evolution Timeline</h3>
94
- </div>
95
-
96
- <div class="model-timeline-controls">
97
- <div class="model-timeline-control">
98
- <label for="timeline-similarity-threshold">Similarity β‰₯</label>
99
- <input type="range" id="timeline-similarity-threshold" min="0.5" max="0.95" step="0.01" value="0.6">
100
- <span class="threshold-value" id="timeline-threshold-display">0.60</span>
101
- </div>
102
-
103
- <div class="model-timeline-control">
104
- <input type="checkbox" id="timeline-multimodal-only">
105
- <label for="timeline-multimodal-only">Only multimodal models</label>
106
- </div>
107
-
108
- <div class="model-timeline-control">
109
- <button id="update-timeline" style="padding: 0.5rem 1rem; background: #f5576c; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.875rem;">
110
- Update Timeline
111
- </button>
112
- </div>
113
- </div>
114
-
115
- <iframe id="timeline-frame" class="model-timeline-iframe" src="about:blank"></iframe>
116
-
117
- <div class="model-timeline-footer">
118
- <strong>Chronological model evolution</strong> showing when similar models were added to the library.
119
- This timeline helps identify patterns in model development and the emergence of model families over time.
120
- Higher similarity thresholds reveal closer relationships between models.
121
- </div>
122
- </div>
123
-
124
- <script>
125
- (function() {
126
- const thresholdSlider = document.getElementById('timeline-similarity-threshold');
127
- const thresholdDisplay = document.getElementById('timeline-threshold-display');
128
- const multimodalCheckbox = document.getElementById('timeline-multimodal-only');
129
- const updateButton = document.getElementById('update-timeline');
130
- const timelineFrame = document.getElementById('timeline-frame');
131
-
132
- // Update threshold display
133
- thresholdSlider.addEventListener('input', function() {
134
- thresholdDisplay.textContent = parseFloat(this.value).toFixed(2);
135
- });
136
-
137
- function updateTimeline() {
138
- const threshold = parseFloat(thresholdSlider.value);
139
- const multimodal = multimodalCheckbox.checked;
140
-
141
- updateButton.textContent = 'Loading...';
142
- updateButton.disabled = true;
143
-
144
- // Create a timeline visualization
145
- const timelineHtml = `
146
- <!DOCTYPE html>
147
- <html>
148
- <head>
149
- <script src="https://d3js.org/d3.v7.min.js"></script>
150
- <style>
151
- body { margin: 0; padding: 20px; font-family: system-ui, sans-serif; background: #fafafa; }
152
- .loading { text-align: center; padding: 50px; color: #6b7280; }
153
- .timeline-container { max-width: 100%; margin: 0 auto; }
154
- .timeline-item {
155
- background: white;
156
- margin: 10px 0;
157
- padding: 15px;
158
- border-radius: 8px;
159
- border-left: 4px solid #f5576c;
160
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
161
- }
162
- .timeline-date { font-weight: 600; color: #f5576c; font-size: 0.875rem; }
163
- .timeline-model { font-weight: 500; margin: 5px 0; }
164
- .timeline-similarity { font-size: 0.75rem; color: #6b7280; }
165
- .metric-badge {
166
- display: inline-block;
167
- background: #f3f4f6;
168
- padding: 2px 8px;
169
- border-radius: 12px;
170
- font-size: 0.75rem;
171
- margin-left: 10px;
172
- }
173
- </style>
174
- </head>
175
- <body>
176
- <div class="loading">Loading model timeline with threshold β‰₯ ${threshold}${multimodal ? ' (multimodal only)' : ''}...</div>
177
- <div class="timeline-container" id="timeline-content" style="display: none;">
178
- <!-- Timeline content will be inserted here -->
179
- </div>
180
- <script>
181
- // Sample timeline data (in a real implementation, this would come from the API)
182
- const sampleTimelineData = [
183
- { date: '2023-01', model: 'LLaVA-1.5', similarity: 0.85, type: 'multimodal' },
184
- { date: '2023-03', model: 'LLaVA-NeXT', similarity: 0.92, type: 'multimodal' },
185
- { date: '2023-06', model: 'Qwen-VL', similarity: 0.71, type: 'multimodal' },
186
- { date: '2023-09', model: 'LLaVA-NeXT-Video', similarity: 0.88, type: 'multimodal' },
187
- { date: '2024-01', model: 'Qwen2-VL', similarity: 0.76, type: 'multimodal' }
188
- ];
189
-
190
- setTimeout(() => {
191
- const filteredData = sampleTimelineData.filter(item => {
192
- if (${multimodal} && item.type !== 'multimodal') return false;
193
- return item.similarity >= ${threshold};
194
- });
195
-
196
- const loadingDiv = document.querySelector('.loading');
197
- const timelineDiv = document.getElementById('timeline-content');
198
-
199
- if (filteredData.length === 0) {
200
- loadingDiv.innerHTML = \`
201
- <div style="text-align: center; padding: 40px; color: #6b7280;">
202
- <p>πŸ“Š No models found with similarity β‰₯ ${threshold}</p>
203
- <p style="font-size: 0.875rem;">Try lowering the similarity threshold to see more model relationships.</p>
204
- </div>
205
- \`;
206
- return;
207
- }
208
-
209
- let timelineHTML = '';
210
- filteredData.forEach(item => {
211
- timelineHTML += \`
212
- <div class="timeline-item">
213
- <div class="timeline-date">\${item.date}</div>
214
- <div class="timeline-model">\${item.model}</div>
215
- <div class="timeline-similarity">
216
- Similarity: \${item.similarity.toFixed(2)}
217
- <span class="metric-badge">\${item.type}</span>
218
- </div>
219
- </div>
220
- \`;
221
- });
222
-
223
- timelineDiv.innerHTML = timelineHTML;
224
- loadingDiv.style.display = 'none';
225
- timelineDiv.style.display = 'block';
226
- }, 1000);
227
- </script>
228
- </body>
229
- </html>`;
230
-
231
- // Encode the HTML for the iframe
232
- const encodedHtml = 'data:text/html;charset=utf-8,' + encodeURIComponent(timelineHtml);
233
- timelineFrame.src = encodedHtml;
234
-
235
- setTimeout(() => {
236
- updateButton.textContent = 'Update Timeline';
237
- updateButton.disabled = false;
238
- }, 1000);
239
- }
240
-
241
- // Initial load
242
- updateTimeline();
243
-
244
- // Update on button click
245
- updateButton.addEventListener('click', updateTimeline);
246
-
247
- // Update on Enter key in slider
248
- thresholdSlider.addEventListener('keydown', function(e) {
249
- if (e.key === 'Enter') {
250
- updateTimeline();
251
- }
252
- });
253
- })();
254
- </script>
 
1
+ <iframe
2
+ src="https://molbap-timeline-1.hf.space"
3
+ style="width:100%; height:680px; border:0"
4
+ allow="clipboard-read; clipboard-write; fullscreen"
5
+ referrerpolicy="no-referrer-when-downgrade"
6
+ ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/fragments/model-visualisation.html ADDED
The diff for this file is too large to render. See raw diff
 
src/fragments/warmup_demo.html CHANGED
@@ -243,7 +243,7 @@
243
 
244
  <div class="demo-container">
245
  <div class="side no-warmup">
246
- <h2 data-no-toc>❌ Without Warmup</h2>
247
  <div class="timing" id="noWarmupTime">0.00s</div>
248
  <div class="layer-counter" id="noWarmupCounter">Layers loaded: 0/10</div>
249
  <div class="phase-indicator" id="noWarmupPhase"></div>
@@ -258,7 +258,7 @@
258
  </div>
259
 
260
  <div class="side with-warmup">
261
- <h2 data-no-toc>βœ… With Warmup</h2>
262
  <div class="timing" id="warmupTime">0.00s</div>
263
  <div class="layer-counter" id="warmupCounter">Layers loaded: 0/10</div>
264
  <div class="phase-indicator" id="warmupPhase"></div>
 
243
 
244
  <div class="demo-container">
245
  <div class="side no-warmup">
246
+ <h4 data-no-toc>❌ Without Warmup</h4>
247
  <div class="timing" id="noWarmupTime">0.00s</div>
248
  <div class="layer-counter" id="noWarmupCounter">Layers loaded: 0/10</div>
249
  <div class="phase-indicator" id="noWarmupPhase"></div>
 
258
  </div>
259
 
260
  <div class="side with-warmup">
261
+ <h4 data-no-toc>βœ… With Warmup</h4>
262
  <div class="timing" id="warmupTime">0.00s</div>
263
  <div class="layer-counter" id="warmupCounter">Layers loaded: 0/10</div>
264
  <div class="phase-indicator" id="warmupPhase"></div>
src/transformers-custom.css CHANGED
@@ -56,20 +56,22 @@
56
  counter-reset: tenet-counter -1; /* Start from 0 */
57
  list-style: none;
58
  padding-left: 0;
59
- display: flex;
60
- flex-direction: column;
61
- gap: 2rem;
 
 
62
  }
63
 
64
  .tenet-list li.tenet {
65
  counter-increment: tenet-counter;
66
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
67
- border: 2px solid transparent;
68
  border-radius: 16px;
69
  padding: 2rem 2rem 2rem 4rem;
70
  margin: 0;
71
  position: relative;
72
- box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
73
  transition: all 0.3s ease;
74
  cursor: pointer;
75
  }
@@ -156,6 +158,12 @@
156
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
157
  }
158
 
 
 
 
 
 
 
159
  .interactive-demo .demo-header {
160
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
161
  color: white;
 
56
  counter-reset: tenet-counter -1; /* Start from 0 */
57
  list-style: none;
58
  padding-left: 0;
59
+ display: grid;
60
+ grid-template-columns: 1fr;
61
+ gap: 2.5rem;
62
+ max-width: 900px;
63
+ margin: 0 auto;
64
  }
65
 
66
  .tenet-list li.tenet {
67
  counter-increment: tenet-counter;
68
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
69
+ border: 2px solid #e2e8f0;
70
  border-radius: 16px;
71
  padding: 2rem 2rem 2rem 4rem;
72
  margin: 0;
73
  position: relative;
74
+ box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
75
  transition: all 0.3s ease;
76
  cursor: pointer;
77
  }
 
158
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
159
  }
160
 
161
+ /* Model visualization fragment styling */
162
+ [id*="plot-model-visualisation"] {
163
+ margin: 1rem -2rem !important;
164
+ width: calc(100% + 4rem) !important;
165
+ }
166
+
167
  .interactive-demo .demo-header {
168
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
169
  color: white;