.gitattributes CHANGED
@@ -18,7 +18,6 @@
18
  *.ot filter=lfs diff=lfs merge=lfs -text
19
  *.parquet filter=lfs diff=lfs merge=lfs -text
20
  *.pb filter=lfs diff=lfs merge=lfs -text
21
- *.pdf filter=lfs diff=lfs merge=lfs -text
22
  *.pickle filter=lfs diff=lfs merge=lfs -text
23
  *.pkl filter=lfs diff=lfs merge=lfs -text
24
  *.png filter=lfs diff=lfs merge=lfs -text
 
18
  *.ot filter=lfs diff=lfs merge=lfs -text
19
  *.parquet filter=lfs diff=lfs merge=lfs -text
20
  *.pb filter=lfs diff=lfs merge=lfs -text
 
21
  *.pickle filter=lfs diff=lfs merge=lfs -text
22
  *.pkl filter=lfs diff=lfs merge=lfs -text
23
  *.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -18,9 +18,6 @@ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-
18
  Instruction to install and run locally
19
 
20
  ```bash
21
- # fetch LFS-tracked files (large assets)
22
- git lfs pull
23
-
24
  npm install
25
  npm run build
26
  npm run dev
 
18
  Instruction to install and run locally
19
 
20
  ```bash
 
 
 
21
  npm install
22
  npm run build
23
  npm run dev
The_Ultra-Scale_Playbook_Training_LLMs_on_GPU_Clusters.pdf DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:274a19a2577ed220cd3a102b4469c44310e4a7c8e8f8ebc36842d907cb51e127
3
- size 14059172
 
 
 
 
assets/images/256px-PDF.png DELETED

Git LFS Details

  • SHA256: 48b7ab9362d78d22ca0d66b2943406759e85cffb86b585176990035d12ac2c7d
  • Pointer size: 129 Bytes
  • Size of remote file: 5.46 kB
assets/images/moon.svg DELETED
assets/images/sun.svg DELETED
convert_to_md.py DELETED
@@ -1,110 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- HTML to Markdown Converter
4
-
5
- This script converts HTML files to Markdown format.
6
- Usage: python html_to_md.py input.html [output.md]
7
- If no output file is specified, it will use the input filename with .md extension.
8
- """
9
-
10
- import sys
11
- import os
12
- import argparse
13
- import html2text
14
- import requests
15
- from urllib.parse import urlparse
16
-
17
- def is_url(path):
18
- """Check if the given path is a URL."""
19
- parsed = urlparse(path)
20
- return parsed.scheme != '' and parsed.netloc != ''
21
-
22
- def convert_html_to_markdown(html_content, **options):
23
- """Convert HTML content to Markdown."""
24
- converter = html2text.HTML2Text()
25
-
26
- # Configure converter options
27
- converter.ignore_links = options.get('ignore_links', False)
28
- converter.ignore_images = options.get('ignore_images', False)
29
- converter.ignore_tables = options.get('ignore_tables', False)
30
- converter.body_width = options.get('body_width', 0) # 0 means no wrapping
31
- converter.unicode_snob = options.get('unicode_snob', True) # Use Unicode instead of ASCII
32
- converter.wrap_links = options.get('wrap_links', False)
33
- converter.inline_links = options.get('inline_links', True)
34
-
35
- # Convert HTML to Markdown
36
- return converter.handle(html_content)
37
-
38
- def main():
39
- parser = argparse.ArgumentParser(description='Convert HTML to Markdown')
40
- parser.add_argument('input', help='Input HTML file or URL')
41
- parser.add_argument('output', nargs='?', help='Output Markdown file (optional)')
42
- parser.add_argument('--ignore-links', action='store_true', help='Ignore links in the HTML')
43
- parser.add_argument('--ignore-images', action='store_true', help='Ignore images in the HTML')
44
- parser.add_argument('--ignore-tables', action='store_true', help='Ignore tables in the HTML')
45
- parser.add_argument('--body-width', type=int, default=0, help='Wrap text at this width (0 for no wrapping)')
46
- parser.add_argument('--unicode', action='store_true', help='Use Unicode characters instead of ASCII approximations')
47
- parser.add_argument('--wrap-links', action='store_true', help='Wrap links in angle brackets')
48
- parser.add_argument('--reference-links', action='store_true', help='Use reference style links instead of inline links')
49
-
50
- args = parser.parse_args()
51
-
52
- # Determine input
53
- if is_url(args.input):
54
- try:
55
- response = requests.get(args.input)
56
- response.raise_for_status()
57
- html_content = response.text
58
- except requests.exceptions.RequestException as e:
59
- print(f"Error fetching URL: {e}", file=sys.stderr)
60
- return 1
61
- else:
62
- try:
63
- with open(args.input, 'r', encoding='utf-8') as f:
64
- html_content = f.read()
65
- except IOError as e:
66
- print(f"Error reading file: {e}", file=sys.stderr)
67
- return 1
68
-
69
- # Configure conversion options
70
- options = {
71
- 'ignore_links': args.ignore_links,
72
- 'ignore_images': args.ignore_images,
73
- 'ignore_tables': args.ignore_tables,
74
- 'body_width': args.body_width,
75
- 'unicode_snob': args.unicode,
76
- 'wrap_links': args.wrap_links,
77
- 'inline_links': not args.reference_links,
78
- }
79
-
80
- # Convert HTML to Markdown
81
- markdown_content = convert_html_to_markdown(html_content, **options)
82
-
83
- # Determine output
84
- if args.output:
85
- output_file = args.output
86
- else:
87
- if is_url(args.input):
88
- # Generate a filename from the URL
89
- url_parts = urlparse(args.input)
90
- base_name = os.path.basename(url_parts.path) or 'index'
91
- if not base_name.endswith('.html'):
92
- base_name += '.html'
93
- output_file = os.path.splitext(base_name)[0] + '.md'
94
- else:
95
- # Generate a filename from the input file
96
- output_file = os.path.splitext(args.input)[0] + '.md'
97
-
98
- # Write output
99
- try:
100
- with open(output_file, 'w', encoding='utf-8') as f:
101
- f.write(markdown_content)
102
- print(f"Conversion successful! Output saved to: {output_file}")
103
- except IOError as e:
104
- print(f"Error writing file: {e}", file=sys.stderr)
105
- return 1
106
-
107
- return 0
108
-
109
- if __name__ == "__main__":
110
- sys.exit(main())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dist/assets/images/256px-PDF.png DELETED

Git LFS Details

  • SHA256: 38ba9d71a429465ee0b469b43dd0969790e9cfe72c02857f31a75412b3c9e81e
  • Pointer size: 129 Bytes
  • Size of remote file: 1.25 kB
dist/assets/images/moon.svg DELETED
dist/assets/images/sun.svg DELETED
dist/bibliography.bib CHANGED
@@ -316,15 +316,6 @@ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
316
  archivePrefix={arXiv},
317
  primaryClass={cs.AI}
318
  }
319
- @misc{liu2023ringattentionblockwisetransformers,
320
- title={Ring Attention with Blockwise Transformers for Near-Infinite Context},
321
- author={Hao Liu and Matei Zaharia and Pieter Abbeel},
322
- year={2023},
323
- eprint={2310.01889},
324
- archivePrefix={arXiv},
325
- primaryClass={cs.CL},
326
- url={https://arxiv.org/abs/2310.01889},
327
- }
328
  @misc{hendrycks2021measuring,
329
  title={Measuring Massive Multitask Language Understanding},
330
  author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
@@ -497,7 +488,7 @@ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
497
  @software{torchao,
498
  title = {torchao: PyTorch native quantization and sparsity for training and inference},
499
  author = {torchao maintainers and contributors},
500
- url = {https://github.com/pytorch/ao},
501
  license = {BSD-3-Clause},
502
  month = oct,
503
  year = {2024}
 
316
  archivePrefix={arXiv},
317
  primaryClass={cs.AI}
318
  }
 
 
 
 
 
 
 
 
 
319
  @misc{hendrycks2021measuring,
320
  title={Measuring Massive Multitask Language Understanding},
321
  author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
 
488
  @software{torchao,
489
  title = {torchao: PyTorch native quantization and sparsity for training and inference},
490
  author = {torchao maintainers and contributors},
491
+ url = {https://github.com/pytorch/torchao},
492
  license = {BSD-3-Clause},
493
  month = oct,
494
  year = {2024}
dist/distill.bundle.js CHANGED
@@ -2146,7 +2146,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2146
  function bylineTemplate(frontMatter) {
2147
  return "\n <div class=\"byline grid\">\n <div>\n <h3>Authors</h3>\n <div>\n ".concat(frontMatter.authors.map(function (author, i) {
2148
  return "\n <span class=\"author\">\n ".concat(author.personalURL ? "\n <a class=\"name\" href=\"".concat(author.personalURL, "\">").concat(author.name) + (i + 1 < frontMatter.authors.length ? "," : "") + "</a>" : "\n <span class=\"name\">".concat(author.name) + (i + 1 < frontMatter.authors.length ? "," : "") + "</span>", "\n </span>\n ");
2149
- }).join(''), "\n </div>\n </div>\n <div >\n <h3>Affiliation</h3>\n <div><a href=\"https://huggingface.co/\">Hugging Face</a>\n </div>\n </div>\n <div >\n <h3>Published</h3>\n <div>Feb 19, 2025</div>\n </div>\n </div>\n\n");
2150
  }
2151
  var Byline = /*#__PURE__*/function (_HTMLElement4) {
2152
  function Byline() {
 
2146
  function bylineTemplate(frontMatter) {
2147
  return "\n <div class=\"byline grid\">\n <div>\n <h3>Authors</h3>\n <div>\n ".concat(frontMatter.authors.map(function (author, i) {
2148
  return "\n <span class=\"author\">\n ".concat(author.personalURL ? "\n <a class=\"name\" href=\"".concat(author.personalURL, "\">").concat(author.name) + (i + 1 < frontMatter.authors.length ? "," : "") + "</a>" : "\n <span class=\"name\">".concat(author.name) + (i + 1 < frontMatter.authors.length ? "," : "") + "</span>", "\n </span>\n ");
2149
+ }).join(''), "\n </div>\n </div>\n <div >\n <h3>Affiliation</h3>\n <div><a href=\"https://huggingface.co/\">Hugging Face</a>\n </div>\n </div>\n <div >\n <h3>Published</h3>\n <div>Feb 19, 2025</div>\n </div>\n </div>\n");
2150
  }
2151
  var Byline = /*#__PURE__*/function (_HTMLElement4) {
2152
  function Byline() {
dist/distill.bundle.js.map CHANGED
The diff for this file is too large to render. See raw diff
 
dist/fragments/banner.html CHANGED
The diff for this file is too large to render. See raw diff
 
dist/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
dist/main.bundle.js CHANGED
@@ -5544,320 +5544,14 @@ function _loadFragments() {
5544
  return _loadFragments.apply(this, arguments);
5545
  }
5546
 
5547
- ;// ./src/syncHFSpacesURLHash.js
5548
- var queryArg = "section";
5549
- function syncHFSpacesURLHash() {
5550
- // Handle explicit section requests (don't update hash automatically on load)
5551
- var hasExplicitRequest = handleExplicitSectionRequest();
5552
-
5553
- // Set up hash change monitoring
5554
- updateHashBasedOnHashChange();
5555
-
5556
- // Always set up scroll monitoring to update hash during scrolling
5557
- setupScrollMonitoring();
5558
-
5559
- // If no explicit request, we don't update the hash on initial load
5560
- // The hash will only start updating when the user scrolls
5561
- }
5562
- function handleExplicitSectionRequest() {
5563
- // Check for section parameter in URL
5564
- var urlParams = new URLSearchParams(window.location.search);
5565
- var sectionId = urlParams.get(queryArg);
5566
-
5567
- // If we have an explicit section request
5568
- if (sectionId) {
5569
- var targetElement = document.getElementById(sectionId);
5570
- if (targetElement) {
5571
- // Slight delay to ensure the browser doesn't try to do its own scrolling first
5572
- setTimeout(function () {
5573
- targetElement.scrollIntoView();
5574
- history.replaceState(null, null, "#".concat(sectionId));
5575
- }, 100);
5576
- }
5577
- return true;
5578
- }
5579
-
5580
- // No explicit section parameter found
5581
- return false;
5582
- }
5583
- function setupScrollMonitoring() {
5584
- // Variables to manage throttling
5585
- var isScrolling = false;
5586
- var lastKnownScrollPosition = 0;
5587
- var initialScroll = true;
5588
-
5589
- // Add the scroll event listener
5590
- window.addEventListener('scroll', function () {
5591
- lastKnownScrollPosition = window.scrollY;
5592
- if (!isScrolling) {
5593
- window.requestAnimationFrame(function () {
5594
- // Skip the first scroll event which might be browser's automatic scroll
5595
- // to a hash on page load
5596
- if (initialScroll) {
5597
- initialScroll = false;
5598
- } else {
5599
- updateHashBasedOnScroll(lastKnownScrollPosition);
5600
- }
5601
- isScrolling = false;
5602
- });
5603
- }
5604
- isScrolling = true;
5605
- });
5606
- }
5607
-
5608
- // Function to update the URL hash based on scroll position
5609
- function updateHashBasedOnScroll(scrollPosition) {
5610
- var closestHeading = findClosestHeading(scrollPosition);
5611
-
5612
- // Update the URL hash if we found a closest element
5613
- if (closestHeading && closestHeading.id) {
5614
- // Only update if the hash is different to avoid unnecessary operations
5615
- if (window.location.hash !== "#".concat(closestHeading.id)) {
5616
- silentlyUpdateHash(closestHeading.id);
5617
- postMessageToHFSpaces(closestHeading.id);
5618
- }
5619
- }
5620
- }
5621
-
5622
- // Find the closest heading to the current scroll position
5623
- function findClosestHeading(scrollPosition) {
5624
- // Get only heading elements with IDs that we want to track
5625
- var headingsWithIds = Array.from(document.querySelectorAll('h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]'));
5626
-
5627
- // Skip if there are no headings with IDs
5628
- if (headingsWithIds.length === 0) return null;
5629
-
5630
- // Find the element closest to the middle of the viewport
5631
- var closestHeading = null;
5632
- var closestDistance = Infinity;
5633
- var viewportMiddle = scrollPosition + window.innerHeight / 2;
5634
-
5635
- // Iterate through all headings to find the closest one
5636
- headingsWithIds.forEach(function (heading) {
5637
- var headingTop = heading.getBoundingClientRect().top + scrollPosition;
5638
- var distance = Math.abs(headingTop - viewportMiddle);
5639
- if (distance < closestDistance) {
5640
- closestDistance = distance;
5641
- closestHeading = heading;
5642
- }
5643
- });
5644
- return closestHeading;
5645
- }
5646
-
5647
- // Update hash without triggering scroll or other side effects
5648
- function silentlyUpdateHash(id) {
5649
- history.replaceState(null, null, "#".concat(id));
5650
- }
5651
- function updateHashBasedOnHashChange() {
5652
- window.addEventListener('hashchange', function () {
5653
- var elementId = window.location.hash.slice(1);
5654
- postMessageToHFSpaces(elementId);
5655
- });
5656
- }
5657
- function postMessageToHFSpaces(elementId) {
5658
- var parentOrigin = "https://huggingface.co";
5659
- window.parent.postMessage({
5660
- queryString: "".concat(queryArg, "=").concat(elementId)
5661
- }, parentOrigin);
5662
- }
5663
-
5664
  ;// ./src/index.js
5665
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = src_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
5666
- function src_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return src_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? src_arrayLikeToArray(r, a) : void 0; } }
5667
- function src_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5668
  // import { plotClusters } from './clusters'
5669
 
5670
 
5671
-
5672
- // Dark mode is now handled manually via a CSS class on <html> and injected styles
5673
-
5674
  document.addEventListener("DOMContentLoaded", function () {
5675
  console.log("DOMContentLoaded");
5676
-
5677
- // Inject minimal styles for the theme toggle button
5678
- var styleEl = document.createElement('style');
5679
- styleEl.textContent = "\n .theme-toggle-btn{position:absolute;top:16px;left:16px;z-index:10000;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:999px;background:rgba(255,255,255,0.9);backdrop-filter:saturate(150%) blur(6px);cursor:pointer;border:1px solid transparent;outline:none;box-shadow:none;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent}\n .theme-toggle-btn:hover{border-color:transparent;box-shadow:none}\n .theme-toggle-btn:focus,.theme-toggle-btn:focus-visible{outline:none;border-color:transparent;box-shadow:none}\n .theme-toggle-btn img{width:22px;height:22px;transition:filter .15s ease}\n .theme-toggle-btn.dark img{filter: brightness(0) invert(1)}\n @media (prefers-color-scheme: dark){.theme-toggle-btn{background:rgba(30,30,30,0.85);border-color:transparent;box-shadow:none}}\n ";
5680
- document.head.appendChild(styleEl);
5681
-
5682
- // Inject dark mode CSS (scoped via html.dark)
5683
- var darkCSS = "\n html.dark{color-scheme:dark}\n html.dark body{background:#242525;color:#e5e7eb}\n html.dark a{color:#93c5fd}\n html.dark .figure-legend{color:#9ca3af}\n html.dark d-article, html.dark d-article p, html.dark d-article aside{color:white !important;}\n html.dark d-contents{background:#242525}\n html.dark d-contents nav a{color:#cbd5e1}\n html.dark d-contents nav a:hover{text-decoration:underline solid rgba(255,255,255,0.6)}\n html.dark .note-box{background:#111;border-left-color:#888}\n html.dark .note-box-title{color:#d1d5db}\n html.dark .note-box-content{color:#e5e7eb}\n html.dark .large-image-background{background:#242525}\n html.dark .boxed-image{background:#111;border-color:#262626;box-shadow:0 4px 6px rgba(0,0,0,.6)}\n html.dark #graph-all,html.dark #controls,html.dark .memory-block,html.dark .activation-memory,html.dark .gradient-memory{background:#111;border-color:#262626;box-shadow:0 4px 6px rgba(0,0,0,.6);color:#e5e7eb}\n html.dark label,html.dark .memory-title{color:#e5e7eb}\n html.dark .memory-value{color:#93c5fd}\n html.dark input,html.dark select,html.dark textarea{background:#0f0f0f;color:#e5e7eb;border:1px solid #333}\n html.dark input:hover,html.dark select:hover,html.dark textarea:hover{border-color:#60a5fa}\n html.dark input:focus,html.dark select:focus,html.dark textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,0.35)}\n html.dark input[type=range]{background:#333}\n html.dark input[type=range]::-webkit-slider-thumb{background:#3b82f6}\n html.dark .plotly_caption{color:#9ca3af}\n html.dark .theme-toggle-btn{background:rgba(30,30,30,0.85);border-color:transparent}\n html.dark d-article img{background:white}\n html.dark summary {color:black !important;}\n html.dark .katex-container {color:white !important;}\n html.dark d-code {background: white!important;}\n html.dark .code-block div { background: white!important;}\n html.dark .code-block div p { color: black!important;}\n /* Table borders in dark mode */\n html.dark table{border-color:rgba(255,255,255,0.3)}\n html.dark th,html.dark td{border-color:rgba(255,255,255,0.3)}\n html.dark thead tr,html.dark tbody tr{border-color:rgba(255,255,255,0.3)}\n html.dark d-byline, html.dark d-article{border-top: 1px solid rgba(255, 255, 255, 0.5);}\n html.dark d-byline h3{color:white;}\n html.dark d-math *, html.dark span.katex{color:white !important;}\n html.dark d-appendix { color: white}\n html.dark h2 { border-bottom: 1px solid rgba(255, 255, 255, 0.25);}\n html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 { color: white}\n html.dark .code-area { color: black;}\n html.dark .code-area a { color: black!important;}\n \n ";
5684
- var darkStyleEl = document.createElement('style');
5685
- darkStyleEl.id = 'darkmode-css';
5686
- darkStyleEl.textContent = darkCSS;
5687
- document.head.appendChild(darkStyleEl);
5688
-
5689
- // Inject equivalent dark CSS into all ShadowRoots using :host-context(.dark)
5690
- // This ensures styles also apply inside web components with Shadow DOM
5691
- var shadowDarkCSS = darkCSS.replace(/html\.dark/g, ':host-context(.dark)');
5692
- var injectDarkStylesIntoRoot = function injectDarkStylesIntoRoot(root) {
5693
- // Only target ShadowRoots here
5694
- if (!root || !(root instanceof ShadowRoot)) return;
5695
- if (root.querySelector('style#darkmode-css-shadow')) return;
5696
- var style = document.createElement('style');
5697
- style.id = 'darkmode-css-shadow';
5698
- style.textContent = shadowDarkCSS;
5699
- root.appendChild(style);
5700
- };
5701
-
5702
- // Normalize inline SVGs: ensure viewBox and preserveAspectRatio for responsiveness
5703
- var normalizeSvgElement = function normalizeSvgElement(svgEl) {
5704
- try {
5705
- if (!svgEl || svgEl.hasAttribute('viewBox')) return;
5706
- var widthAttr = svgEl.getAttribute('width');
5707
- var heightAttr = svgEl.getAttribute('height');
5708
- if (!widthAttr || !heightAttr) return;
5709
- var width = parseFloat(widthAttr);
5710
- var height = parseFloat(heightAttr);
5711
- if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) return;
5712
- svgEl.setAttribute('viewBox', "0 0 ".concat(width, " ").concat(height));
5713
- if (!svgEl.hasAttribute('preserveAspectRatio')) {
5714
- svgEl.setAttribute('preserveAspectRatio', 'xMidYMid meet');
5715
- }
5716
- } catch (_) {
5717
- // no-op
5718
- }
5719
- };
5720
- var processRootForSVGs = function processRootForSVGs(root) {
5721
- if (!root || typeof root.querySelectorAll !== 'function') return;
5722
- var svgs = root.querySelectorAll('svg:not([viewBox])');
5723
- svgs.forEach(function (svg) {
5724
- return normalizeSvgElement(svg);
5725
- });
5726
- };
5727
- var _scanNodeForShadowRoots = function scanNodeForShadowRoots(node) {
5728
- if (!node) return;
5729
- if (node.shadowRoot) {
5730
- injectDarkStylesIntoRoot(node.shadowRoot);
5731
- processRootForSVGs(node.shadowRoot);
5732
- }
5733
- // Traverse children
5734
- if (node.childNodes && node.childNodes.length) {
5735
- node.childNodes.forEach(function (child) {
5736
- // Process SVGs in this subtree as well
5737
- processRootForSVGs(child);
5738
- _scanNodeForShadowRoots(child);
5739
- });
5740
- }
5741
- };
5742
-
5743
- // Intercept future shadow roots
5744
- var originalAttachShadow = Element.prototype.attachShadow;
5745
- Element.prototype.attachShadow = function (init) {
5746
- var shadow = originalAttachShadow.call(this, init);
5747
- try {
5748
- injectDarkStylesIntoRoot(shadow);
5749
- processRootForSVGs(shadow);
5750
- } catch (e) {}
5751
- return shadow;
5752
- };
5753
-
5754
- // Initial sweep for any existing shadow roots
5755
- _scanNodeForShadowRoots(document.documentElement);
5756
- // Initial pass for regular DOM SVGs
5757
- processRootForSVGs(document);
5758
-
5759
- // Observe DOM mutations to catch dynamically added components
5760
- var mo = new MutationObserver(function (mutations) {
5761
- var _iterator = _createForOfIteratorHelper(mutations),
5762
- _step;
5763
- try {
5764
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
5765
- var m = _step.value;
5766
- m.addedNodes && m.addedNodes.forEach(function (n) {
5767
- _scanNodeForShadowRoots(n);
5768
- processRootForSVGs(n);
5769
- });
5770
- }
5771
- } catch (err) {
5772
- _iterator.e(err);
5773
- } finally {
5774
- _iterator.f();
5775
- }
5776
- });
5777
- mo.observe(document.documentElement, {
5778
- childList: true,
5779
- subtree: true
5780
- });
5781
-
5782
- // Create the toggle button
5783
- var btn = document.createElement('button');
5784
- btn.className = 'theme-toggle-btn';
5785
- btn.setAttribute('type', 'button');
5786
- btn.setAttribute('aria-label', 'Basculer le mode sombre');
5787
- // Reuse icons declared in HTML and move them into the button
5788
- var sunIcon = document.getElementById('sunIcon');
5789
- var moonIcon = document.getElementById('moonIcon');
5790
- if (sunIcon && moonIcon) {
5791
- // Make sure they adopt button sizing
5792
- sunIcon.style.display = 'none';
5793
- sunIcon.style.width = '22px';
5794
- sunIcon.style.height = '22px';
5795
- moonIcon.style.display = 'none';
5796
- moonIcon.style.width = '22px';
5797
- moonIcon.style.height = '22px';
5798
- btn.appendChild(sunIcon);
5799
- btn.appendChild(moonIcon);
5800
- }
5801
- document.body.appendChild(btn);
5802
- var setIcon = function setIcon(enabled) {
5803
- // enabled = dark mode enabled -> show sun (to indicate turning off), hide moon
5804
- sunIcon.style.display = enabled ? '' : 'none';
5805
- moonIcon.style.display = enabled ? 'none' : '';
5806
- btn.setAttribute('title', enabled ? 'DΓ©sactiver le mode sombre' : 'Activer le mode sombre');
5807
- btn.setAttribute('aria-pressed', String(enabled));
5808
- btn.classList.toggle('dark', enabled);
5809
- };
5810
- var setDark = function setDark(enabled) {
5811
- document.documentElement.classList.toggle('dark', enabled);
5812
- setIcon(enabled);
5813
- };
5814
- var THEME_KEY = 'theme';
5815
- var savedTheme = null;
5816
- try {
5817
- savedTheme = localStorage.getItem(THEME_KEY);
5818
- } catch (e) {}
5819
- var media = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');
5820
- var prefersDark = media ? media.matches : false;
5821
- // Initialisation: priorité à la préférence sauvegardée, sinon préférence système
5822
- if (savedTheme === 'dark') {
5823
- setDark(true);
5824
- } else if (savedTheme === 'light') {
5825
- setDark(false);
5826
- } else {
5827
- setDark(prefersDark);
5828
- }
5829
-
5830
- // Si l'utilisateur a déjà choisi manuellement, on ne suit plus la préférence système
5831
- var manualOverride = savedTheme === 'dark' || savedTheme === 'light';
5832
-
5833
- // React to system preference changes dynamically (no persistence)
5834
- if (media && typeof media.addEventListener === 'function') {
5835
- media.addEventListener('change', function (e) {
5836
- if (!manualOverride) {
5837
- setDark(e.matches);
5838
- }
5839
- });
5840
- } else if (media && typeof media.addListener === 'function') {
5841
- // Fallback for older browsers
5842
- media.addListener(function (e) {
5843
- if (!manualOverride) {
5844
- setDark(e.matches);
5845
- }
5846
- });
5847
- }
5848
-
5849
- // Toggle handler β€” for rΓ©duire les glitches, attendre le next frame avant d'ajuster l'icΓ΄ne
5850
- btn.addEventListener('click', function () {
5851
- manualOverride = true;
5852
- var next = !document.documentElement.classList.contains('dark');
5853
- setDark(next);
5854
- try {
5855
- localStorage.setItem(THEME_KEY, next ? 'dark' : 'light');
5856
- } catch (e) {}
5857
- });
5858
  loadFragments();
5859
  init_memory_plot();
5860
- syncHFSpacesURLHash();
5861
  }, {
5862
  once: true
5863
  });
 
5544
  return _loadFragments.apply(this, arguments);
5545
  }
5546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5547
  ;// ./src/index.js
 
 
 
5548
  // import { plotClusters } from './clusters'
5549
 
5550
 
 
 
 
5551
  document.addEventListener("DOMContentLoaded", function () {
5552
  console.log("DOMContentLoaded");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5553
  loadFragments();
5554
  init_memory_plot();
 
5555
  }, {
5556
  once: true
5557
  });
dist/main.bundle.js.map CHANGED
The diff for this file is too large to render. See raw diff
 
dist/style.css CHANGED
@@ -304,6 +304,7 @@ d-contents nav > ul > li > a:hover {
304
  border-radius: 6px;
305
  /* Add this to ensure the box only takes up needed space */
306
  display: inline-block;
 
307
  }
308
 
309
  .note-box-title {
@@ -596,141 +597,3 @@ select[name="presets"] {
596
  border-radius: 8px;
597
  }
598
 
599
- .order-button-second {
600
- background: linear-gradient(135deg, #6DB4C4, #D4A5B8);
601
- color: white;
602
- font-size: 18px;
603
- font-weight: 600;
604
- padding: 20px 20px;
605
- border: none;
606
- border-radius: 12px;
607
- cursor: pointer;
608
- text-transform: uppercase;
609
- letter-spacing: 1px;
610
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
611
- transition: all 0.3s ease;
612
- position: relative;
613
- overflow: hidden;
614
- }
615
- .order-button-second:hover {
616
- transform: translateY(-2px);
617
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
618
- }
619
-
620
- .order-button:active {
621
- transform: translateY(0);
622
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
623
- }
624
-
625
- .order-button-second::before {
626
- content: '';
627
- position: absolute;
628
- top: 0;
629
- left: -100%;
630
- width: 100%;
631
- height: 100%;
632
- background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
633
- transition: left 0.5s ease;
634
- }
635
-
636
- .order-button-second:hover::before {
637
- left: 100%;
638
- }
639
-
640
- .order-button {
641
- background: linear-gradient(135deg, #6DB4C4, #D4A5B8);
642
- color: white;
643
- font-size: 18px;
644
- font-weight: 600;
645
- padding: 16px 32px;
646
- border: none;
647
- border-radius: 12px;
648
- cursor: pointer;
649
- text-transform: uppercase;
650
- letter-spacing: 1px;
651
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
652
- transition: all 0.3s ease;
653
- position: relative;
654
- overflow: hidden;
655
- }
656
-
657
- .order-button:hover {
658
- transform: translateY(-2px);
659
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
660
- }
661
-
662
- .order-button:active {
663
- transform: translateY(0);
664
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
665
- }
666
-
667
- .order-button::before {
668
- content: '';
669
- position: absolute;
670
- top: 0;
671
- left: -100%;
672
- width: 100%;
673
- height: 100%;
674
- background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
675
- transition: left 0.5s ease;
676
- }
677
-
678
- .order-button:hover::before {
679
- left: 100%;
680
- }
681
- .order-button-container-second {
682
- /* display: flex; */
683
- justify-content: center;
684
- margin: 0px 0;
685
- }
686
-
687
- .order-button-container {
688
- display: flex;
689
- justify-content: center;
690
- margin: 0px 0 40px 0;
691
- }
692
-
693
- d-article img {
694
- width: 100%!important;
695
- }
696
-
697
-
698
- iframe, .js-plotly-plot {
699
- width: 100%!important;
700
- margin-bottom: 20px;
701
- }
702
-
703
- .modebar-container {
704
- display: none;
705
- }
706
-
707
- #graph-container {
708
- display: grid; grid-template-columns: 1fr 1fr; align-items: center;
709
- }
710
-
711
- @media (max-width: 768px) {
712
- #graph-container {
713
- grid-template-columns: 1fr;
714
- }
715
- }
716
-
717
- @media (max-width: 1024px) {
718
- #graph-container {
719
- grid-template-columns: 1fr;
720
- }
721
- #graph-all {
722
- margin-right: 0px;
723
- }
724
- #controls {
725
- margin-left: 0px;
726
- }
727
- }
728
-
729
- .main-plot-container svg {
730
- background: transparent !important;
731
- }
732
-
733
- .large-image-background-transparent {
734
- margin-left: 0px;
735
- margin-right: 0px;
736
- }
 
304
  border-radius: 6px;
305
  /* Add this to ensure the box only takes up needed space */
306
  display: inline-block;
307
+ width: 100%;
308
  }
309
 
310
  .note-box-title {
 
597
  border-radius: 8px;
598
  }
599
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.json CHANGED
@@ -11,7 +11,7 @@
11
  "description": "--- title: \"The Nanotron Gigablogpost\" emoji: 🍷 colorFrom: pink colorTo: red sdk: static pinned: false header: mini ---",
12
  "main": "index.js",
13
  "scripts": {
14
- "dev": "webpack serve --open --hot",
15
  "build": "NODE_ENV=production webpack"
16
  },
17
  "author": "",
 
11
  "description": "--- title: \"The Nanotron Gigablogpost\" emoji: 🍷 colorFrom: pink colorTo: red sdk: static pinned: false header: mini ---",
12
  "main": "index.js",
13
  "scripts": {
14
+ "dev": "webpack serve --open",
15
  "build": "NODE_ENV=production webpack"
16
  },
17
  "author": "",
src/bibliography.bib CHANGED
@@ -316,15 +316,6 @@ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
316
  archivePrefix={arXiv},
317
  primaryClass={cs.AI}
318
  }
319
- @misc{liu2023ringattentionblockwisetransformers,
320
- title={Ring Attention with Blockwise Transformers for Near-Infinite Context},
321
- author={Hao Liu and Matei Zaharia and Pieter Abbeel},
322
- year={2023},
323
- eprint={2310.01889},
324
- archivePrefix={arXiv},
325
- primaryClass={cs.CL},
326
- url={https://arxiv.org/abs/2310.01889},
327
- }
328
  @misc{hendrycks2021measuring,
329
  title={Measuring Massive Multitask Language Understanding},
330
  author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
@@ -497,7 +488,7 @@ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
497
  @software{torchao,
498
  title = {torchao: PyTorch native quantization and sparsity for training and inference},
499
  author = {torchao maintainers and contributors},
500
- url = {https://github.com/pytorch/ao},
501
  license = {BSD-3-Clause},
502
  month = oct,
503
  year = {2024}
 
316
  archivePrefix={arXiv},
317
  primaryClass={cs.AI}
318
  }
 
 
 
 
 
 
 
 
 
319
  @misc{hendrycks2021measuring,
320
  title={Measuring Massive Multitask Language Understanding},
321
  author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
 
488
  @software{torchao,
489
  title = {torchao: PyTorch native quantization and sparsity for training and inference},
490
  author = {torchao maintainers and contributors},
491
+ url = {https://github.com/pytorch/torchao},
492
  license = {BSD-3-Clause},
493
  month = oct,
494
  year = {2024}
src/distill.js CHANGED
@@ -2105,7 +2105,6 @@ d-appendix > distill-appendix {
2105
  <div>Feb 19, 2025</div>
2106
  </div>
2107
  </div>
2108
-
2109
  `;
2110
  }
2111
 
 
2105
  <div>Feb 19, 2025</div>
2106
  </div>
2107
  </div>
 
2108
  `;
2109
  }
2110
 
src/fragments/banner.html CHANGED
The diff for this file is too large to render. See raw diff
 
src/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
src/index.js CHANGED
@@ -1,239 +1,9 @@
1
  // import { plotClusters } from './clusters'
2
  import { init_memory_plot } from './memory'
3
  import { loadFragments } from './fragmentLoader'
4
- import { syncHFSpacesURLHash } from './syncHFSpacesURLHash'
5
- // Dark mode is now handled manually via a CSS class on <html> and injected styles
6
 
7
  document.addEventListener("DOMContentLoaded", () => {
8
  console.log("DOMContentLoaded");
9
-
10
- // Inject minimal styles for the theme toggle button
11
- const styleEl = document.createElement('style');
12
- styleEl.textContent = `
13
- .theme-toggle-btn{position:absolute;top:16px;left:16px;z-index:10000;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:999px;background:rgba(255,255,255,0.9);backdrop-filter:saturate(150%) blur(6px);cursor:pointer;border:1px solid transparent;outline:none;box-shadow:none;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent}
14
- .theme-toggle-btn:hover{border-color:transparent;box-shadow:none}
15
- .theme-toggle-btn:focus,.theme-toggle-btn:focus-visible{outline:none;border-color:transparent;box-shadow:none}
16
- .theme-toggle-btn img{width:22px;height:22px;transition:filter .15s ease}
17
- .theme-toggle-btn.dark img{filter: brightness(0) invert(1)}
18
- @media (prefers-color-scheme: dark){.theme-toggle-btn{background:rgba(30,30,30,0.85);border-color:transparent;box-shadow:none}}
19
- `;
20
- document.head.appendChild(styleEl);
21
-
22
- // Inject dark mode CSS (scoped via html.dark)
23
- const darkCSS = `
24
- html.dark{color-scheme:dark}
25
- html.dark body{background:#242525;color:#e5e7eb}
26
- html.dark a{color:#93c5fd}
27
- html.dark .figure-legend{color:#9ca3af}
28
- html.dark d-article, html.dark d-article p, html.dark d-article aside{color:white !important;}
29
- html.dark d-contents{background:#242525}
30
- html.dark d-contents nav a{color:#cbd5e1}
31
- html.dark d-contents nav a:hover{text-decoration:underline solid rgba(255,255,255,0.6)}
32
- html.dark .note-box{background:#111;border-left-color:#888}
33
- html.dark .note-box-title{color:#d1d5db}
34
- html.dark .note-box-content{color:#e5e7eb}
35
- html.dark .large-image-background{background:#242525}
36
- html.dark .boxed-image{background:#111;border-color:#262626;box-shadow:0 4px 6px rgba(0,0,0,.6)}
37
- html.dark #graph-all,html.dark #controls,html.dark .memory-block,html.dark .activation-memory,html.dark .gradient-memory{background:#111;border-color:#262626;box-shadow:0 4px 6px rgba(0,0,0,.6);color:#e5e7eb}
38
- html.dark label,html.dark .memory-title{color:#e5e7eb}
39
- html.dark .memory-value{color:#93c5fd}
40
- html.dark input,html.dark select,html.dark textarea{background:#0f0f0f;color:#e5e7eb;border:1px solid #333}
41
- html.dark input:hover,html.dark select:hover,html.dark textarea:hover{border-color:#60a5fa}
42
- html.dark input:focus,html.dark select:focus,html.dark textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,0.35)}
43
- html.dark input[type=range]{background:#333}
44
- html.dark input[type=range]::-webkit-slider-thumb{background:#3b82f6}
45
- html.dark .plotly_caption{color:#9ca3af}
46
- html.dark .theme-toggle-btn{background:rgba(30,30,30,0.85);border-color:transparent}
47
- html.dark d-article img{background:white}
48
- html.dark summary {color:black !important;}
49
- html.dark .katex-container {color:white !important;}
50
- html.dark d-code {background: white!important;}
51
- html.dark .code-block div { background: white!important;}
52
- html.dark .code-block div p { color: black!important;}
53
- /* Table borders in dark mode */
54
- html.dark table{border-color:rgba(255,255,255,0.3)}
55
- html.dark th,html.dark td{border-color:rgba(255,255,255,0.3)}
56
- html.dark thead tr,html.dark tbody tr{border-color:rgba(255,255,255,0.3)}
57
- html.dark d-byline, html.dark d-article{border-top: 1px solid rgba(255, 255, 255, 0.5);}
58
- html.dark d-byline h3{color:white;}
59
- html.dark d-math *, html.dark span.katex{color:white !important;}
60
- html.dark d-appendix { color: white}
61
- html.dark h2 { border-bottom: 1px solid rgba(255, 255, 255, 0.25);}
62
- html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 { color: white}
63
- html.dark .code-area { color: black;}
64
- html.dark .code-area a { color: black!important;}
65
-
66
- `;
67
- const darkStyleEl = document.createElement('style');
68
- darkStyleEl.id = 'darkmode-css';
69
- darkStyleEl.textContent = darkCSS;
70
- document.head.appendChild(darkStyleEl);
71
-
72
- // Inject equivalent dark CSS into all ShadowRoots using :host-context(.dark)
73
- // This ensures styles also apply inside web components with Shadow DOM
74
- const shadowDarkCSS = darkCSS.replace(/html\.dark/g, ':host-context(.dark)');
75
-
76
- const injectDarkStylesIntoRoot = (root) => {
77
- // Only target ShadowRoots here
78
- if (!root || !(root instanceof ShadowRoot)) return;
79
- if (root.querySelector('style#darkmode-css-shadow')) return;
80
- const style = document.createElement('style');
81
- style.id = 'darkmode-css-shadow';
82
- style.textContent = shadowDarkCSS;
83
- root.appendChild(style);
84
- };
85
-
86
- // Normalize inline SVGs: ensure viewBox and preserveAspectRatio for responsiveness
87
- const normalizeSvgElement = (svgEl) => {
88
- try {
89
- if (!svgEl || svgEl.hasAttribute('viewBox')) return;
90
- const widthAttr = svgEl.getAttribute('width');
91
- const heightAttr = svgEl.getAttribute('height');
92
- if (!widthAttr || !heightAttr) return;
93
- const width = parseFloat(widthAttr);
94
- const height = parseFloat(heightAttr);
95
- if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) return;
96
- svgEl.setAttribute('viewBox', `0 0 ${width} ${height}`);
97
- if (!svgEl.hasAttribute('preserveAspectRatio')) {
98
- svgEl.setAttribute('preserveAspectRatio', 'xMidYMid meet');
99
- }
100
- } catch (_) {
101
- // no-op
102
- }
103
- };
104
-
105
- const processRootForSVGs = (root) => {
106
- if (!root || typeof root.querySelectorAll !== 'function') return;
107
- const svgs = root.querySelectorAll('svg:not([viewBox])');
108
- svgs.forEach((svg) => normalizeSvgElement(svg));
109
- };
110
-
111
- const scanNodeForShadowRoots = (node) => {
112
- if (!node) return;
113
- if (node.shadowRoot) {
114
- injectDarkStylesIntoRoot(node.shadowRoot);
115
- processRootForSVGs(node.shadowRoot);
116
- }
117
- // Traverse children
118
- if (node.childNodes && node.childNodes.length) {
119
- node.childNodes.forEach((child) => {
120
- // Process SVGs in this subtree as well
121
- processRootForSVGs(child);
122
- scanNodeForShadowRoots(child);
123
- });
124
- }
125
- };
126
-
127
- // Intercept future shadow roots
128
- const originalAttachShadow = Element.prototype.attachShadow;
129
- Element.prototype.attachShadow = function(init) {
130
- const shadow = originalAttachShadow.call(this, init);
131
- try {
132
- injectDarkStylesIntoRoot(shadow);
133
- processRootForSVGs(shadow);
134
- } catch (e) {}
135
- return shadow;
136
- };
137
-
138
- // Initial sweep for any existing shadow roots
139
- scanNodeForShadowRoots(document.documentElement);
140
- // Initial pass for regular DOM SVGs
141
- processRootForSVGs(document);
142
-
143
- // Observe DOM mutations to catch dynamically added components
144
- const mo = new MutationObserver((mutations) => {
145
- for (const m of mutations) {
146
- m.addedNodes && m.addedNodes.forEach((n) => {
147
- scanNodeForShadowRoots(n);
148
- processRootForSVGs(n);
149
- });
150
- }
151
- });
152
- mo.observe(document.documentElement, { childList: true, subtree: true });
153
-
154
- // Create the toggle button
155
- const btn = document.createElement('button');
156
- btn.className = 'theme-toggle-btn';
157
- btn.setAttribute('type', 'button');
158
- btn.setAttribute('aria-label', 'Basculer le mode sombre');
159
- // Reuse icons declared in HTML and move them into the button
160
- const sunIcon = document.getElementById('sunIcon');
161
- const moonIcon = document.getElementById('moonIcon');
162
-
163
- if (sunIcon && moonIcon) {
164
- // Make sure they adopt button sizing
165
- sunIcon.style.display = 'none';
166
- sunIcon.style.width = '22px';
167
- sunIcon.style.height = '22px';
168
- moonIcon.style.display = 'none';
169
- moonIcon.style.width = '22px';
170
- moonIcon.style.height = '22px';
171
- btn.appendChild(sunIcon);
172
- btn.appendChild(moonIcon);
173
- }
174
- document.body.appendChild(btn);
175
-
176
- const setIcon = (enabled) => {
177
- // enabled = dark mode enabled -> show sun (to indicate turning off), hide moon
178
- sunIcon.style.display = enabled ? '' : 'none';
179
- moonIcon.style.display = enabled ? 'none' : '';
180
- btn.setAttribute('title', enabled ? 'DΓ©sactiver le mode sombre' : 'Activer le mode sombre');
181
- btn.setAttribute('aria-pressed', String(enabled));
182
- btn.classList.toggle('dark', enabled);
183
- };
184
-
185
- const setDark = (enabled) => {
186
- document.documentElement.classList.toggle('dark', enabled);
187
- setIcon(enabled);
188
- };
189
-
190
- const THEME_KEY = 'theme';
191
- let savedTheme = null;
192
- try {
193
- savedTheme = localStorage.getItem(THEME_KEY);
194
- } catch (e) {}
195
-
196
- const media = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');
197
- const prefersDark = media ? media.matches : false;
198
- // Initialisation: priorité à la préférence sauvegardée, sinon préférence système
199
- if (savedTheme === 'dark') {
200
- setDark(true);
201
- } else if (savedTheme === 'light') {
202
- setDark(false);
203
- } else {
204
- setDark(prefersDark);
205
- }
206
-
207
- // Si l'utilisateur a déjà choisi manuellement, on ne suit plus la préférence système
208
- let manualOverride = savedTheme === 'dark' || savedTheme === 'light';
209
-
210
- // React to system preference changes dynamically (no persistence)
211
- if (media && typeof media.addEventListener === 'function') {
212
- media.addEventListener('change', (e) => {
213
- if (!manualOverride) {
214
- setDark(e.matches);
215
- }
216
- });
217
- } else if (media && typeof media.addListener === 'function') {
218
- // Fallback for older browsers
219
- media.addListener((e) => {
220
- if (!manualOverride) {
221
- setDark(e.matches);
222
- }
223
- });
224
- }
225
-
226
- // Toggle handler β€” for rΓ©duire les glitches, attendre le next frame avant d'ajuster l'icΓ΄ne
227
- btn.addEventListener('click', () => {
228
- manualOverride = true;
229
- const next = !document.documentElement.classList.contains('dark');
230
- setDark(next);
231
- try {
232
- localStorage.setItem(THEME_KEY, next ? 'dark' : 'light');
233
- } catch (e) {}
234
- });
235
-
236
  loadFragments();
237
  init_memory_plot();
238
- syncHFSpacesURLHash();
239
  }, { once: true });
 
1
  // import { plotClusters } from './clusters'
2
  import { init_memory_plot } from './memory'
3
  import { loadFragments } from './fragmentLoader'
 
 
4
 
5
  document.addEventListener("DOMContentLoaded", () => {
6
  console.log("DOMContentLoaded");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  loadFragments();
8
  init_memory_plot();
 
9
  }, { once: true });
src/style.css CHANGED
@@ -304,6 +304,7 @@ d-contents nav > ul > li > a:hover {
304
  border-radius: 6px;
305
  /* Add this to ensure the box only takes up needed space */
306
  display: inline-block;
 
307
  }
308
 
309
  .note-box-title {
@@ -596,141 +597,3 @@ select[name="presets"] {
596
  border-radius: 8px;
597
  }
598
 
599
- .order-button-second {
600
- background: linear-gradient(135deg, #6DB4C4, #D4A5B8);
601
- color: white;
602
- font-size: 18px;
603
- font-weight: 600;
604
- padding: 20px 20px;
605
- border: none;
606
- border-radius: 12px;
607
- cursor: pointer;
608
- text-transform: uppercase;
609
- letter-spacing: 1px;
610
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
611
- transition: all 0.3s ease;
612
- position: relative;
613
- overflow: hidden;
614
- }
615
- .order-button-second:hover {
616
- transform: translateY(-2px);
617
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
618
- }
619
-
620
- .order-button:active {
621
- transform: translateY(0);
622
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
623
- }
624
-
625
- .order-button-second::before {
626
- content: '';
627
- position: absolute;
628
- top: 0;
629
- left: -100%;
630
- width: 100%;
631
- height: 100%;
632
- background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
633
- transition: left 0.5s ease;
634
- }
635
-
636
- .order-button-second:hover::before {
637
- left: 100%;
638
- }
639
-
640
- .order-button {
641
- background: linear-gradient(135deg, #6DB4C4, #D4A5B8);
642
- color: white;
643
- font-size: 18px;
644
- font-weight: 600;
645
- padding: 16px 32px;
646
- border: none;
647
- border-radius: 12px;
648
- cursor: pointer;
649
- text-transform: uppercase;
650
- letter-spacing: 1px;
651
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
652
- transition: all 0.3s ease;
653
- position: relative;
654
- overflow: hidden;
655
- }
656
-
657
- .order-button:hover {
658
- transform: translateY(-2px);
659
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
660
- }
661
-
662
- .order-button:active {
663
- transform: translateY(0);
664
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
665
- }
666
-
667
- .order-button::before {
668
- content: '';
669
- position: absolute;
670
- top: 0;
671
- left: -100%;
672
- width: 100%;
673
- height: 100%;
674
- background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
675
- transition: left 0.5s ease;
676
- }
677
-
678
- .order-button:hover::before {
679
- left: 100%;
680
- }
681
- .order-button-container-second {
682
- /* display: flex; */
683
- justify-content: center;
684
- margin: 0px 0;
685
- }
686
-
687
- .order-button-container {
688
- display: flex;
689
- justify-content: center;
690
- margin: 0px 0 40px 0;
691
- }
692
-
693
- d-article img {
694
- width: 100%!important;
695
- }
696
-
697
-
698
- iframe, .js-plotly-plot {
699
- width: 100%!important;
700
- margin-bottom: 20px;
701
- }
702
-
703
- .modebar-container {
704
- display: none;
705
- }
706
-
707
- #graph-container {
708
- display: grid; grid-template-columns: 1fr 1fr; align-items: center;
709
- }
710
-
711
- @media (max-width: 768px) {
712
- #graph-container {
713
- grid-template-columns: 1fr;
714
- }
715
- }
716
-
717
- @media (max-width: 1024px) {
718
- #graph-container {
719
- grid-template-columns: 1fr;
720
- }
721
- #graph-all {
722
- margin-right: 0px;
723
- }
724
- #controls {
725
- margin-left: 0px;
726
- }
727
- }
728
-
729
- .main-plot-container svg {
730
- background: transparent !important;
731
- }
732
-
733
- .large-image-background-transparent {
734
- margin-left: 0px;
735
- margin-right: 0px;
736
- }
 
304
  border-radius: 6px;
305
  /* Add this to ensure the box only takes up needed space */
306
  display: inline-block;
307
+ width: 100%;
308
  }
309
 
310
  .note-box-title {
 
597
  border-radius: 8px;
598
  }
599
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/syncHFSpacesURLHash.js DELETED
@@ -1,124 +0,0 @@
1
- const queryArg = "section";
2
-
3
- function syncHFSpacesURLHash() {
4
- // Handle explicit section requests (don't update hash automatically on load)
5
- const hasExplicitRequest = handleExplicitSectionRequest();
6
-
7
- // Set up hash change monitoring
8
- updateHashBasedOnHashChange();
9
-
10
- // Always set up scroll monitoring to update hash during scrolling
11
- setupScrollMonitoring();
12
-
13
- // If no explicit request, we don't update the hash on initial load
14
- // The hash will only start updating when the user scrolls
15
- }
16
-
17
- function handleExplicitSectionRequest() {
18
- // Check for section parameter in URL
19
- const urlParams = new URLSearchParams(window.location.search);
20
- const sectionId = urlParams.get(queryArg);
21
-
22
- // If we have an explicit section request
23
- if (sectionId) {
24
- const targetElement = document.getElementById(sectionId);
25
- if (targetElement) {
26
- // Slight delay to ensure the browser doesn't try to do its own scrolling first
27
- setTimeout(() => {
28
- targetElement.scrollIntoView();
29
- history.replaceState(null, null, `#${sectionId}`);
30
- }, 100);
31
- }
32
- return true;
33
- }
34
-
35
- // No explicit section parameter found
36
- return false;
37
- }
38
-
39
- function setupScrollMonitoring() {
40
- // Variables to manage throttling
41
- let isScrolling = false;
42
- let lastKnownScrollPosition = 0;
43
- let initialScroll = true;
44
-
45
- // Add the scroll event listener
46
- window.addEventListener('scroll', function() {
47
- lastKnownScrollPosition = window.scrollY;
48
-
49
- if (!isScrolling) {
50
- window.requestAnimationFrame(function() {
51
- // Skip the first scroll event which might be browser's automatic scroll
52
- // to a hash on page load
53
- if (initialScroll) {
54
- initialScroll = false;
55
- } else {
56
- updateHashBasedOnScroll(lastKnownScrollPosition);
57
- }
58
- isScrolling = false;
59
- });
60
- }
61
-
62
- isScrolling = true;
63
- });
64
- }
65
-
66
- // Function to update the URL hash based on scroll position
67
- function updateHashBasedOnScroll(scrollPosition) {
68
- const closestHeading = findClosestHeading(scrollPosition);
69
-
70
- // Update the URL hash if we found a closest element
71
- if (closestHeading && closestHeading.id) {
72
- // Only update if the hash is different to avoid unnecessary operations
73
- if (window.location.hash !== `#${closestHeading.id}`) {
74
- silentlyUpdateHash(closestHeading.id);
75
- postMessageToHFSpaces(closestHeading.id);
76
- }
77
- }
78
- }
79
-
80
- // Find the closest heading to the current scroll position
81
- function findClosestHeading(scrollPosition) {
82
- // Get only heading elements with IDs that we want to track
83
- const headingsWithIds = Array.from(document.querySelectorAll('h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]'));
84
-
85
- // Skip if there are no headings with IDs
86
- if (headingsWithIds.length === 0) return null;
87
-
88
- // Find the element closest to the middle of the viewport
89
- let closestHeading = null;
90
- let closestDistance = Infinity;
91
- const viewportMiddle = scrollPosition + window.innerHeight / 2;
92
-
93
- // Iterate through all headings to find the closest one
94
- headingsWithIds.forEach(heading => {
95
- const headingTop = heading.getBoundingClientRect().top + scrollPosition;
96
- const distance = Math.abs(headingTop - viewportMiddle);
97
-
98
- if (distance < closestDistance) {
99
- closestDistance = distance;
100
- closestHeading = heading;
101
- }
102
- });
103
-
104
- return closestHeading;
105
- }
106
-
107
- // Update hash without triggering scroll or other side effects
108
- function silentlyUpdateHash(id) {
109
- history.replaceState(null, null, `#${id}`);
110
- }
111
-
112
- function updateHashBasedOnHashChange() {
113
- window.addEventListener('hashchange', () => {
114
- const elementId = window.location.hash.slice(1);
115
- postMessageToHFSpaces(elementId);
116
- });
117
- }
118
-
119
- function postMessageToHFSpaces(elementId) {
120
- const parentOrigin = "https://huggingface.co";
121
- window.parent.postMessage({ queryString: `${queryArg}=${elementId}` }, parentOrigin);
122
- }
123
-
124
- export { syncHFSpacesURLHash };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ultra_blog.md DELETED
The diff for this file is too large to render. See raw diff
 
webpack.config.js CHANGED
@@ -99,14 +99,9 @@ module.exports = {
99
  ],
100
  devtool: process.env.NODE_ENV === 'production' ? 'source-map' : 'eval-source-map',
101
  devServer: {
102
- static: {
103
- directory: path.join(__dirname, 'dist'),
104
- },
105
- hot: true,
106
- watchFiles: ['src/**/*'],
107
- client: {
108
- overlay: true,
109
- },
110
  },
111
  mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
112
  optimization: {
 
99
  ],
100
  devtool: process.env.NODE_ENV === 'production' ? 'source-map' : 'eval-source-map',
101
  devServer: {
102
+ static: "./dist", // Serve files from the 'dist' directory
103
+ open: process.env.NODE_ENV !== 'production', // Automatically open the browser unless in production
104
+ hot: process.env.NODE_ENV !== 'production', // Enable hot module replacement unless in production
 
 
 
 
 
105
  },
106
  mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
107
  optimization: {