omurberaisik commited on
Commit
8a72f3e
·
verified ·
1 Parent(s): 735e1c8

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +566 -0
index.html ADDED
@@ -0,0 +1,566 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>VeroLM</title>
7
+ <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='525 200 500 630'%3E%3Cpolygon fill='%23e10b17' points='537,340 626,304 626,594 537,528'/%3E%3Cpolygon fill='%23e10b17' points='665,314 803,265 803,703 665,614'/%3E%3Cpolygon fill='%23e10b17' points='840,270 1012,212 1012,817 840,710'/%3E%3C/svg%3E">
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Sora:wght@400;600;800&display=swap" rel="stylesheet">
11
+ <style>
12
+ :root{
13
+ --bg:#ececee; --fg:#141416; --mut:#5d5d65; --line:#cfcfd4; --line2:#8d8d95; --card:#f6f6f7;
14
+ --plate:transparent; --blue:#2563eb; --green:#16a34a;
15
+ --font:"Sora",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
16
+ }
17
+ @media (prefers-color-scheme: dark){
18
+ :root{ --bg:#111113; --fg:#ececee; --mut:#9b9ba3; --line:#2c2c31; --line2:#55555d; --card:#1a1a1d; --plate:#ececee; --blue:#3b82f6; --green:#22c55e; }
19
+ }
20
+ *{box-sizing:border-box}
21
+ html{scroll-behavior:smooth}
22
+ body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font);line-height:1.6;-webkit-font-smoothing:antialiased}
23
+ a{color:inherit}
24
+ :focus-visible{outline:2px solid var(--blue);outline-offset:2px}
25
+ .wrap{max-width:1040px;margin:0 auto;padding:0 24px}
26
+
27
+ /* logo */
28
+ .l-ink{fill:#0c0c0f}
29
+ .l-red{fill:url(#redg)}
30
+ .logo{display:block;background:var(--plate);border-radius:18px;padding:26px;box-sizing:border-box}
31
+
32
+ header{display:flex;align-items:center;justify-content:space-between;padding:20px 0}
33
+ .brand{display:flex;align-items:center;gap:12px;font-weight:800;font-size:1.15rem;letter-spacing:-.01em;text-decoration:none}
34
+ .brand svg{width:36px;height:44px;background:var(--plate);border-radius:7px;padding:5px;box-sizing:border-box}
35
+ nav{display:flex;align-items:center;gap:8px}
36
+ .chip{font:inherit;font-size:.85rem;color:var(--fg);background:transparent;border:1px solid var(--line);border-radius:999px;padding:6px 14px;cursor:pointer;text-decoration:none;display:inline-block}
37
+ .chip:hover{border-color:var(--mut)}
38
+ select.chip{appearance:none;-webkit-appearance:none;background-color:var(--bg);padding-right:26px;background-repeat:no-repeat;background-position:right 11px center;background-size:9px 6px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%238d8d95' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
39
+
40
+ .hero{display:grid;grid-template-columns:1.2fr .8fr;align-items:center;gap:40px;padding:56px 0 72px}
41
+ .hero h1{font-size:clamp(2.4rem,6vw,4.4rem);line-height:1.02;letter-spacing:-.035em;font-weight:800;margin:0 0 20px}
42
+ .hero p{max-width:46ch;color:var(--mut);font-size:1.08rem;margin:0 0 28px}
43
+ .cta{display:flex;gap:10px;flex-wrap:wrap}
44
+ .btn{font:inherit;font-weight:600;font-size:.9rem;border:0;border-radius:8px;padding:10px 18px;cursor:pointer;color:#fff;text-decoration:none;display:inline-block}
45
+ .btn.blue{background:var(--blue)} .btn.green{background:var(--green)}
46
+ .btn:hover{filter:brightness(1.1)}
47
+ .btn[disabled]{opacity:.5;cursor:wait}
48
+ .card .btn[disabled]{opacity:.35;cursor:not-allowed;filter:grayscale(.7)}
49
+ .note{border-left:3px solid var(--line2);padding:2px 0 2px 14px;margin:0 0 28px;color:var(--mut);font-size:.92rem;max-width:70ch}
50
+ .btn.ghost{background:transparent;color:var(--fg);border:1px solid var(--line)}
51
+ .hero svg{width:min(100%,300px);height:auto;justify-self:center}
52
+ .b{transform-box:fill-box;transform-origin:bottom;animation:rise .9s cubic-bezier(.2,.8,.2,1) both}
53
+ .b2{animation-delay:.12s}.b3{animation-delay:.24s}
54
+ @keyframes rise{from{transform:scaleY(.15);opacity:0}to{transform:none;opacity:1}}
55
+ @media (prefers-reduced-motion: reduce){.b{animation:none}}
56
+
57
+ section{padding:40px 0}
58
+ h2{font-size:1.7rem;letter-spacing:-.02em;margin:0 0 6px}
59
+ .sub{color:var(--mut);margin:0 0 28px;max-width:60ch}
60
+
61
+ /* series + models */
62
+ .series{margin-bottom:36px}
63
+ .series h3{display:flex;align-items:baseline;gap:12px;margin:0 0 14px;font-size:1.15rem;border-bottom:1px solid var(--line);padding-bottom:10px}
64
+ .series h3 a{text-decoration:none}
65
+ .series h3 a:hover{text-decoration:underline}
66
+ .series .desc{color:var(--mut);margin:0 0 14px;max-width:70ch;font-size:.95rem}
67
+ .series h3 small{color:var(--mut);font-weight:400;font-size:.85rem}
68
+ .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}
69
+ .card{background:var(--card);border:1px solid var(--line);border-left:4px solid var(--line2);border-radius:6px;padding:18px;display:flex;flex-direction:column;gap:10px}
70
+ .card h4{margin:0;font-size:1rem;word-break:break-word}
71
+ .meta{display:flex;flex-wrap:wrap;gap:6px;font-size:.78rem;color:var(--mut)}
72
+ .meta span{border:1px solid var(--line);border-radius:4px;padding:1px 8px}
73
+ .card .act{display:flex;gap:8px;margin-top:auto;padding-top:6px}
74
+ .empty{text-align:center;padding:48px 16px;color:var(--mut)}
75
+ .empty strong{display:block;color:var(--fg);font-size:1.2rem;margin-bottom:6px}
76
+ .skel{height:130px;border-radius:6px;background:linear-gradient(90deg,var(--card),var(--line),var(--card));background-size:200% 100%;animation:sh 1.4s infinite}
77
+ @keyframes sh{to{background-position:-200% 0}}
78
+
79
+ /* approach */
80
+ .pr{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:28px}
81
+ .pr h3{margin:0 0 6px;font-size:1rem}
82
+ .pr p{margin:0;color:var(--mut);font-size:.95rem}
83
+
84
+ footer{border-top:1px solid var(--line);margin-top:48px;padding:28px 0 48px;color:var(--mut);font-size:.9rem;display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px}
85
+
86
+ /* run dialog */
87
+ dialog{border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--fg);width:min(640px,92vw);padding:24px;font-family:var(--font)}
88
+ dialog::backdrop{background:rgba(0,0,0,.55)}
89
+ dialog h3{margin:0 0 4px;word-break:break-all}
90
+ #rstat{color:var(--mut);font-size:.88rem;margin:0 0 14px;min-height:1.4em}
91
+ textarea{width:100%;min-height:90px;font:inherit;font-size:.95rem;background:var(--bg);color:var(--fg);border:1px solid var(--line);border-radius:6px;padding:10px;resize:vertical}
92
+ #rout{white-space:pre-wrap;background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:12px;margin-top:12px;min-height:60px;max-height:260px;overflow:auto;font-size:.92rem}
93
+ .drow{display:flex;gap:8px;margin-top:12px;justify-content:flex-end}
94
+
95
+ @media (max-width:760px){
96
+ .hero{grid-template-columns:1fr;padding-top:24px}
97
+ .hero svg{width:120px;order:-1;justify-self:start}
98
+ }
99
+ </style>
100
+ </head>
101
+ <body>
102
+
103
+ <!-- Logo definition: transparent background, the dark parts adapt to the theme -->
104
+ <svg width="0" height="0" style="position:absolute;overflow:hidden" aria-hidden="true">
105
+ <defs>
106
+ <linearGradient id="redg" x1="0" y1="0" x2="0" y2="1">
107
+ <stop offset="0" stop-color="#ee0f1a"/>
108
+ <stop offset="1" stop-color="#860000"/>
109
+ </linearGradient>
110
+ <symbol id="logo" viewBox="525 200 500 630" width="100%" height="100%">
111
+ <g class="b b1"><polygon class="l-ink" points="537,340 626,304 626,594 537,528"/><path class="l-red" d="M537 362Q580 450 612 522Q622 545 626 594L537 528Z"/></g>
112
+ <g class="b b2"><polygon class="l-ink" points="665,314 803,265 803,703 665,614"/><path class="l-red" d="M803 375L692 503Q680 517 680 535L680 624L803 703Z"/></g>
113
+ <g class="b b3"><polygon class="l-ink" points="840,270 1012,212 1012,817 840,710"/><path class="l-red" d="M1012 346L866 506Q855 518 855 534L855 719L1012 817Z"/></g>
114
+ </symbol>
115
+ </defs>
116
+ </svg>
117
+
118
+ <div class="wrap">
119
+ <header>
120
+ <a class="brand" href="#top" aria-label="VeroLM">
121
+ <svg viewBox="0 0 500 630" aria-hidden="true"><use href="#logo"/></svg>
122
+ VeroLM
123
+ </a>
124
+ <nav>
125
+ <a class="chip" href="#models" data-t="navModels">Models</a>
126
+ <a class="chip" id="hflink" href="#" target="_blank" rel="noopener">Hugging Face</a>
127
+ <select class="chip" id="lang" aria-label="Language"><option value="en">English</option><option value="tr">Türkçe</option><option value="fr">Français</option><option value="es">Español</option></select>
128
+ </nav>
129
+ </header>
130
+
131
+ <div class="hero" id="top">
132
+ <div>
133
+ <h1 data-t="h1">Open models at every size.</h1>
134
+ <p data-t="lead">Hızlı, verimli ve çoğunlukla açık kaynak. Küçükten büyüğe dil modelleri eğitiyor, herkesin ücretsiz kullanabilmesi için yayınlıyoruz.</p>
135
+ <div class="cta">
136
+ <a class="btn blue" href="#models" data-t="ctaModels">Browse models</a>
137
+ <a class="btn ghost" id="hflink2" href="#" target="_blank" rel="noopener" data-t="ctaHF">Follow on Hugging Face</a>
138
+ </div>
139
+ </div>
140
+ <svg class="logo" viewBox="0 0 500 630" role="img" aria-label="VeroLM logosu"><use href="#logo"/></svg>
141
+ </div>
142
+
143
+ <section id="models">
144
+ <h2 data-t="hModels">Series and models</h2>
145
+ <p class="sub" data-t="subModels">Hugging Face’teki güncel modellerimiz. İncele ile model sayfasını aç, Çalıştır ile tarayıcında dene.</p>
146
+ <p class="note" data-t="note">Not every model runs directly in the browser. Mostly newer, compatible models do. If a model can’t run, its Run button is greyed out and can’t be clicked.</p>
147
+ <div id="list"><div class="grid"><div class="skel"></div><div class="skel"></div><div class="skel"></div></div></div>
148
+ </section>
149
+
150
+ <section>
151
+ <h2 data-t="hAbout">Yaklaşımımız</h2>
152
+ <p class="sub" data-t="subAbout">VeroLM, bağımsız bir yapay zeka laboratuvarı.</p>
153
+ <div class="pr">
154
+ <div><h3 data-t="p1h">Önce kalite</h3><p data-t="p1">Sadece var olan değil, gerçekten iyi çalışan modeller üretiyoruz.</p></div>
155
+ <div><h3 data-t="p2h">Hız ve verimlilik</h3><p data-t="p2">Her model, insanların elindeki donanımda çalışacak şekilde olabildiğince hızlı ve optimize.</p></div>
156
+ <div><h3 data-t="p3h">Varsayılan olarak açık</h3><p data-t="p3">Eğittiklerimizin çoğu açık kaynak ve ��cretsiz. İyi yapay zeka ücretli duvarların arkasında kalmamalı.</p></div>
157
+ <div><h3 data-t="p4h">Deneysellik</h3><p data-t="p4">Mimari, eğitim ve optimizasyonda az denenmiş fikirleri sürekli deniyoruz.</p></div>
158
+ </div>
159
+ </section>
160
+
161
+ <footer>
162
+ <span>© VeroLM</span>
163
+ <span data-t="foot">Merakla geliştirildi, herkes için yayınlandı.</span>
164
+ </footer>
165
+ </div>
166
+
167
+ <dialog id="dlg">
168
+ <h3 id="rname"></h3>
169
+ <p id="rstat"></p>
170
+ <textarea id="rin" data-t-ph="phPrompt" placeholder="Bir şey yaz..."></textarea>
171
+ <div id="rout" hidden></div>
172
+ <div class="drow">
173
+ <button class="btn ghost" id="rclose" type="button" data-t="close">Kapat</button>
174
+ <button class="btn green" id="rgo" type="button" data-t="run">Çalıştır</button>
175
+ </div>
176
+ </dialog>
177
+
178
+ <script>
179
+ const ORG = "VeroLM"; // Hugging Face organization name
180
+
181
+ const T = {
182
+ en:{sErrCustom:"The model’s own runner failed to start. Check the browser console for details.",note:"Not every model runs directly in the browser. Mostly newer, compatible models do. If a model can’t run, its Run button is greyed out and can’t be clicked.",noRun:"Not available in the browser",navModels:"Models",h1:"Open models at every size.",lead:"Fast, efficient and mostly open source. We train language models from tiny to large and release them for everyone to use for free.",ctaModels:"Browse models",ctaHF:"Follow on Hugging Face",hModels:"Series and models",subModels:"Our current models on Hugging Face. Inspect opens the model page, Run tries it in your browser.",hAbout:"Our approach",subAbout:"VeroLM is an independent AI lab.",p1h:"Quality first",p1:"We build models that genuinely perform, not just models that exist.",p2h:"Speed and efficiency",p2:"Every model is as fast and optimized as we can make it, so it runs on the hardware people actually have.",p3h:"Open by default",p3:"Most of what we train is open source and free. Good AI shouldn’t sit behind a paywall.",p4h:"Experimentation",p4:"We constantly try rarely explored ideas in architecture, training and optimization.",foot:"Built with curiosity, released for everyone.",
183
+ inspect:"Inspect",run:"Run",close:"Close",model:"model",models:"models",dl:"downloads",oopsT:"Oops, no models here yet.",oopsB:"New releases will show up here as soon as they’re published.",phPrompt:"Type something...",
184
+ sNoGpu:"WebGPU isn’t available in this browser, so the slower CPU mode will be used.",sGpu:"WebGPU is ready. The first run downloads the model and keeps it in your browser.",sLoad:"Loading model",sReady:"Model ready.",sGen:"Generating...",sErr:"Couldn’t open this model in the browser. It may not be published in a browser-ready (ONNX) format yet."},
185
+ tr:{sErrCustom:"Modelin kendi çalıştırıcısı başlatılamadı. Ayrıntı için tarayıcı konsoluna bak.",note:"Her model doğrudan tarayıcıda çalışmaz, genellikle yeni ve uygun modeller çalışır. Çalışmayacak modellerde Çalıştır düğmesi sönük olur ve tıklanamaz.",noRun:"Bu model tarayıcıda çalışmaz",navModels:"Modeller",h1:"Her boyutta açık modeller.",lead:"Hızlı, verimli ve çoğunlukla açık kaynak. Küçükten büyüğe dil modelleri eğitiyor, herkesin ücretsiz kullanabilmesi için yayınlıyoruz.",ctaModels:"Modelleri incele",ctaHF:"Hugging Face’te takip et",hModels:"Seriler ve modeller",subModels:"Hugging Face’teki güncel modellerimiz. İncele ile model sayfasını aç, Çalıştır ile tarayıcında dene.",hAbout:"Yaklaşımımız",subAbout:"VeroLM, bağımsız bir yapay zeka laboratuvarı.",p1h:"Önce kalite",p1:"Sadece var olan değil, gerçekten iyi çalışan modeller üretiyoruz.",p2h:"Hız ve verimlilik",p2:"Her model, insanların elindeki donanımda çalışacak şekilde olabildiğince hızlı ve optimize.",p3h:"Varsayılan olarak açık",p3:"Eğittiklerimizin çoğu açık kaynak ve ücretsiz. İyi yapay zeka ücretli duvarların arkasında kalmamalı.",p4h:"Deneysellik",p4:"Mimari, eğitim ve optimizasyonda az denenmiş fikirleri sürekli deniyoruz.",foot:"Merakla geliştirildi, herkes için yayınlandı.",
186
+ inspect:"İncele",run:"Çalıştır",close:"Kapat",model:"model",models:"model",dl:"indirme",oopsT:"Oops, burada henüz model yok.",oopsB:"Yeni modeller yayınlandığında burada görünecek.",phPrompt:"Bir şey yaz...",
187
+ sNoGpu:"Bu tarayıcıda WebGPU yok, daha yavaş olan CPU modu kullanılacak.",sGpu:"WebGPU hazır. İlk çalıştırmada model indirilir ve tarayıcıda saklanır.",sLoad:"Model yükleniyor",sReady:"Model hazır.",sGen:"Yanıt üretiliyor...",sErr:"Model tarayıcıda açılamadı. Bu model henüz tarayıcı (ONNX) biçiminde yayınlanmamış olabilir."},
188
+ fr:{sErrCustom:"Le runner propre au modèle n’a pas pu démarrer. Consultez la console du navigateur.",note:"Tous les modèles ne fonctionnent pas directement dans le navigateur, en général seuls les modèles récents et compatibles le font. Si un modèle ne peut pas s’exécuter, son bouton Exécuter est grisé et non cliquable.",noRun:"Ce modèle ne fonctionne pas dans le navigateur",navModels:"Modèles",h1:"Des modèles ouverts, à toutes les tailles.",lead:"Rapides, efficaces et surtout open source. Nous entraînons des modèles de langage du plus petit au plus grand et les publions pour que tout le monde puisse les utiliser gratuitement.",ctaModels:"Voir les modèles",ctaHF:"Suivre sur Hugging Face",hModels:"Séries et modèles",subModels:"Nos modèles actuels sur Hugging Face. Examiner ouvre la page du modèle, Exécuter l’essaie dans votre navigateur.",hAbout:"Notre approche",subAbout:"VeroLM est un laboratoire d’IA indépendant.",p1h:"La qualité d’abord",p1:"Nous construisons des modèles qui performent vraiment, pas seulement des modèles qui existent.",p2h:"Vitesse et efficacité",p2:"Chaque modèle est aussi rapide et optimisé que possible, pour tourner sur le matériel que les gens ont vraiment.",p3h:"Ouvert par défaut",p3:"La plupart de nos modèles sont open source et gratuits. Une bonne IA ne devrait pas être derrière un paywall.",p4h:"Expérimentation",p4:"Nous testons sans cesse des idées peu explorées en architecture, entraînement et optimisation.",foot:"Créé avec curiosité, publié pour tous.",
189
+ inspect:"Examiner",run:"Exécuter",close:"Fermer",model:"modèle",models:"modèles",dl:"téléchargements",oopsT:"Oups, aucun modèle ici pour l’instant.",oopsB:"Les nouvelles versions apparaîtront ici dès leur publication.",phPrompt:"Écrivez quelque chose...",
190
+ sNoGpu:"WebGPU n’est pas disponible dans ce navigateur, le mode CPU, plus lent, sera utilisé.",sGpu:"WebGPU est prêt. Le premier lancement télécharge le modèle et le conserve dans votre navigateur.",sLoad:"Chargement du modèle",sReady:"Modèle prêt.",sGen:"Génération en cours...",sErr:"Impossible d’ouvrir ce modèle dans le navigateur. Il n’est peut-être pas encore publié au format ONNX."},
191
+ es:{sErrCustom:"El runner propio del modelo no pudo iniciarse. Revisa la consola del navegador.",note:"No todos los modelos funcionan directamente en el navegador, normalmente solo los modelos nuevos y compatibles. Si un modelo no puede ejecutarse, su botón Ejecutar aparece atenuado y no se puede pulsar.",noRun:"Este modelo no funciona en el navegador",navModels:"Modelos",h1:"Modelos abiertos de todos los tamaños.",lead:"Rápidos, eficientes y en su mayoría de código abierto. Entrenamos modelos de lenguaje, de pequeños a grandes, y los publicamos para que todos puedan usarlos gratis.",ctaModels:"Ver modelos",ctaHF:"Seguir en Hugging Face",hModels:"Series y modelos",subModels:"Nuestros modelos actuales en Hugging Face. Inspeccionar abre la página del modelo, Ejecutar lo prueba en tu navegador.",hAbout:"Nuestro enfoque",subAbout:"VeroLM es un laboratorio de IA independiente.",p1h:"Primero la calidad",p1:"Construimos modelos que realmente funcionan bien, no solo modelos que existen.",p2h:"Velocidad y eficiencia",p2:"Cada modelo es tan rápido y optimizado como podemos, para que funcione en el hardware que la gente realmente tiene.",p3h:"Abierto por defecto",p3:"La mayoría de lo que entrenamos es de código abierto y gratuito. La buena IA no debería estar detrás de un muro de pago.",p4h:"Experimentación",p4:"Probamos constantemente ideas poco exploradas en arquitectura, entrenamiento y optimización.",foot:"Hecho con curiosidad, publicado para todos.",
192
+ inspect:"Inspeccionar",run:"Ejecutar",close:"Cerrar",model:"modelo",models:"modelos",dl:"descargas",oopsT:"Vaya, aún no hay modelos aquí.",oopsB:"Las nuevas versiones aparecerán aquí en cuanto se publiquen.",phPrompt:"Escribe algo...",
193
+ sNoGpu:"WebGPU no está disponible en este navegador, se usará el modo CPU, más lento.",sGpu:"WebGPU está listo. La primera ejecución descarga el modelo y lo guarda en tu navegador.",sLoad:"Cargando modelo",sReady:"Modelo listo.",sGen:"Generando...",sErr:"No se pudo abrir este modelo en el navegador. Puede que aún no esté publicado en formato ONNX."}
194
+ };
195
+ let lang = "en";
196
+ const $ = s => document.querySelector(s);
197
+ const t = k => T[lang][k];
198
+
199
+ function applyLang(){
200
+ document.documentElement.lang = lang;
201
+ document.querySelectorAll("[data-t]").forEach(n => n.textContent = t(n.dataset.t));
202
+ document.querySelectorAll("[data-t-ph]").forEach(n => n.placeholder = t(n.dataset.tPh));
203
+ $("#lang").value = lang;
204
+ render();
205
+ }
206
+ $("#lang").onchange = e => { lang = e.target.value; applyLang(); };
207
+ ["#hflink","#hflink2"].forEach(s => $(s).href = "https://huggingface.co/" + ORG);
208
+
209
+ /* ---- series = Hugging Face collections of the organization ---- */
210
+ let SERIES = null;
211
+ const unit = {k:.001,m:1,b:1000};
212
+ function sizeOf(name){
213
+ const m = name.match(/(\d+(?:\.\d+)?)\s?([kmb])\b/i);
214
+ return m ? m[1]+m[2].toUpperCase() : null;
215
+ }
216
+ function fmt(n){ return n>=1e6 ? (n/1e6).toFixed(1)+"M" : n>=1e3 ? (n/1e3).toFixed(1)+"K" : String(n); }
217
+ function el(tag, props = {}, ...kids){
218
+ const e = Object.assign(document.createElement(tag), props);
219
+ kids.flat().forEach(k => e.append(k));
220
+ return e;
221
+ }
222
+
223
+ async function load(){
224
+ try{
225
+ // The list endpoint truncates each collection to 4 items, so fetch every collection again for its full item list.
226
+ const r = await fetch("https://huggingface.co/api/collections?owner=" + encodeURIComponent(ORG) + "&limit=100&sort=lastModified");
227
+ if(!r.ok) throw 0;
228
+ const list = await r.json();
229
+ const full = await Promise.all(list.map(async c => {
230
+ try{
231
+ const d = await fetch("https://huggingface.co/api/collections/" + c.slug);
232
+ return d.ok ? await d.json() : c;
233
+ }catch(e){ return c; }
234
+ }));
235
+ SERIES = full
236
+ .map(c => ({
237
+ title: c.title, desc: c.description || "", url: "https://huggingface.co/collections/" + c.slug,
238
+ models: (c.items || []).filter(i => i.type === "model")
239
+ }))
240
+ .filter(c => c.models.length);
241
+ // A model is runnable if (a) its repo has a verolm.json key file, (b) it ships a verolm-runner.js, or (c) it has standard ONNX files.
242
+ const safe = n => typeof n === "string" && /^[\w.\-\/]+$/.test(n) && !n.includes("..") && !n.startsWith("/");
243
+ await Promise.all(SERIES.flatMap(s => s.models).map(async m => {
244
+ m.runtime = null; m.runnable = false;
245
+ try{
246
+ const d = await (await fetch("https://huggingface.co/api/models/" + m.id)).json();
247
+ const f = (d.siblings || []).map(x => x.rfilename);
248
+ const own = m.id.toLowerCase().startsWith(ORG.toLowerCase() + "/");
249
+ m.onnxFiles = f.filter(n => /^onnx\/.+\.onnx$/.test(n));
250
+ const hasOnnx = m.onnxFiles.length > 0 && f.includes("config.json") && f.includes("tokenizer.json");
251
+ if(own && f.includes("verolm.json")){
252
+ try{
253
+ const mf = await (await fetch("https://huggingface.co/" + m.id + "/resolve/main/verolm.json")).json();
254
+ const runner = mf.runner || "verolm-runner.js";
255
+ if(mf.runtime === "custom" && safe(runner) && f.includes(runner) && (!mf.weights || (safe(mf.weights) && f.includes(mf.weights)))){
256
+ m.runtime = "custom"; m.manifest = mf;
257
+ }else if(mf.runtime === "onnx" && hasOnnx){ m.runtime = "transformers"; m.manifest = mf; }
258
+ }catch(e){}
259
+ }else if(own && f.includes("verolm-runner.js")){ m.runtime = "custom"; m.manifest = {}; }
260
+ if(!m.runtime && hasOnnx) m.runtime = "transformers";
261
+ m.runnable = !!m.runtime;
262
+ }catch(e){ m.runtime = null; m.runnable = false; }
263
+ }));
264
+ }catch(e){ SERIES = []; }
265
+ render();
266
+ }
267
+
268
+ function render(){
269
+ const box = $("#list");
270
+ if(SERIES === null) return;
271
+ box.replaceChildren();
272
+ if(!SERIES.length){
273
+ box.append(el("div",{className:"empty"}, el("strong",{textContent:t("oopsT")}), el("span",{textContent:t("oopsB")})));
274
+ return;
275
+ }
276
+ SERIES.forEach(sr => {
277
+ const grid = el("div",{className:"grid"});
278
+ sr.models.forEach(m => {
279
+ const name = m.id.split("/").pop();
280
+ const size = sizeOf(name);
281
+ const meta = el("div",{className:"meta"});
282
+ if(size) meta.append(el("span",{textContent:size}));
283
+ if(m.manifest && typeof m.manifest.arch === "string") meta.append(el("span",{textContent:m.manifest.arch.slice(0,24)}));
284
+ if(m.pipeline_tag) meta.append(el("span",{textContent:m.pipeline_tag}));
285
+ if(m.downloads != null) meta.append(el("span",{textContent:fmt(m.downloads)+" "+t("dl")}));
286
+ const run = el("button",{className:"btn green",type:"button",textContent:t("run")});
287
+ run.disabled = !m.runnable;
288
+ if(!m.runnable) run.title = t("noRun");
289
+ run.onclick = () => openRun(m);
290
+ grid.append(el("div",{className:"card"},
291
+ el("h4",{textContent:name}), meta,
292
+ el("div",{className:"act"},
293
+ el("a",{className:"btn blue",href:"https://huggingface.co/"+m.id,target:"_blank",rel:"noopener",textContent:t("inspect")}),
294
+ run)));
295
+ });
296
+ const n = sr.models.length;
297
+ box.append(el("div",{className:"series"},
298
+ el("h3",{}, el("a",{href:sr.url,target:"_blank",rel:"noopener",textContent:sr.title}), el("small",{textContent:n+" "+(n===1?t("model"):t("models"))})),
299
+ sr.desc ? el("p",{className:"desc",textContent:sr.desc}) : "",
300
+ grid));
301
+ });
302
+ }
303
+
304
+ /* ---- PyTorch .pt reader: parses zip + a restricted pickle, never executes code ---- */
305
+ const PT_TYPES = {FloatStorage:["float32",Float32Array],DoubleStorage:["float64",Float64Array],HalfStorage:["float16",Uint16Array],BFloat16Storage:["bfloat16",Uint16Array],LongStorage:["int64",BigInt64Array],IntStorage:["int32",Int32Array],ShortStorage:["int16",Int16Array],CharStorage:["int8",Int8Array],ByteStorage:["uint8",Uint8Array],BoolStorage:["bool",Uint8Array]};
306
+ async function inflateRaw(u8){
307
+ const out = new Blob([u8]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
308
+ return new Uint8Array(await new Response(out).arrayBuffer());
309
+ }
310
+ async function readZip(buf){
311
+ const dv = new DataView(buf), u8 = new Uint8Array(buf);
312
+ let e = buf.byteLength - 22;
313
+ while(e >= 0 && dv.getUint32(e, true) !== 0x06054b50) e--;
314
+ if(e < 0) throw new Error("This .pt file isn’t in the zip-based PyTorch format (legacy files aren’t supported).");
315
+ const n = dv.getUint16(e + 10, true); let off = dv.getUint32(e + 16, true);
316
+ const files = new Map(), td = new TextDecoder();
317
+ for(let i = 0; i < n; i++){
318
+ if(dv.getUint32(off, true) !== 0x02014b50) throw new Error("Corrupt zip directory.");
319
+ const method = dv.getUint16(off + 10, true), csize = dv.getUint32(off + 20, true);
320
+ const nl = dv.getUint16(off + 28, true), xl = dv.getUint16(off + 30, true), cl = dv.getUint16(off + 32, true), lh = dv.getUint32(off + 42, true);
321
+ if(csize === 0xffffffff || lh === 0xffffffff) throw new Error("Zip64 (very large) .pt files aren’t supported yet.");
322
+ files.set(td.decode(u8.subarray(off + 46, off + 46 + nl)), {method, csize, lh});
323
+ off += 46 + nl + xl + cl;
324
+ }
325
+ const get = async name => {
326
+ const f = files.get(name); if(!f) throw new Error("Missing " + name + " in .pt file.");
327
+ const p = f.lh + 30 + dv.getUint16(f.lh + 26, true) + dv.getUint16(f.lh + 28, true);
328
+ const raw = u8.subarray(p, p + f.csize);
329
+ if(f.method === 0) return raw;
330
+ if(f.method === 8) return inflateRaw(raw);
331
+ throw new Error("Unsupported zip compression in .pt file.");
332
+ };
333
+ return {files, get};
334
+ }
335
+ function ptGlobal(fn, a){
336
+ switch(fn && fn.g){
337
+ case "collections.OrderedDict": return new Map();
338
+ case "torch._utils._rebuild_tensor_v2": case "torch._utils._rebuild_tensor": return {tensor:true, storage:a[0], offset:a[1], shape:a[2], stride:a[3]};
339
+ case "torch._utils._rebuild_parameter": return a[0];
340
+ default: throw new Error("Blocked object in .pt (" + (fn && fn.g || "unknown") + "). Save a plain state_dict: torch.save(model.state_dict(), 'model.pt').");
341
+ }
342
+ }
343
+ function unpickle(b){
344
+ const st = [], memo = new Map(), marks = [], td = new TextDecoder();
345
+ const dv = new DataView(b.buffer, b.byteOffset, b.byteLength);
346
+ let i = 0, nm = 0;
347
+ const popMark = () => st.splice(marks.pop());
348
+ const take = n => { const v = b.subarray(i, i + n); i += n; return v; };
349
+ const line = () => { let j = i; while(b[j] !== 10) j++; const v = td.decode(b.subarray(i, j)); i = j + 1; return v; };
350
+ for(;;){
351
+ const op = b[i++];
352
+ switch(op){
353
+ case 0x80: i++; break;
354
+ case 0x95: i += 8; break;
355
+ case 0x7d: st.push(new Map()); break;
356
+ case 0x5d: case 0x29: st.push([]); break;
357
+ case 0x28: marks.push(st.length); break;
358
+ case 0x71: memo.set(b[i++], st[st.length - 1]); break;
359
+ case 0x72: memo.set(dv.getUint32(i, true), st[st.length - 1]); i += 4; break;
360
+ case 0x94: memo.set(nm++, st[st.length - 1]); break;
361
+ case 0x68: st.push(memo.get(b[i++])); break;
362
+ case 0x6a: st.push(memo.get(dv.getUint32(i, true))); i += 4; break;
363
+ case 0x4e: st.push(null); break;
364
+ case 0x88: st.push(true); break;
365
+ case 0x89: st.push(false); break;
366
+ case 0x4b: st.push(b[i++]); break;
367
+ case 0x4d: st.push(dv.getUint16(i, true)); i += 2; break;
368
+ case 0x4a: st.push(dv.getInt32(i, true)); i += 4; break;
369
+ case 0x8a: { const n = b[i++]; let v = 0n; for(let k = n - 1; k >= 0; k--) v = (v << 8n) | BigInt(b[i + k]); if(n && (b[i + n - 1] & 0x80)) v -= 1n << BigInt(8 * n); i += n; st.push(Number(v)); break; }
370
+ case 0x47: st.push(dv.getFloat64(i, false)); i += 8; break;
371
+ case 0x58: case 0x54: { const n = dv.getUint32(i, true); i += 4; st.push(td.decode(take(n))); break; }
372
+ case 0x8c: case 0x55: { const n = b[i++]; st.push(td.decode(take(n))); break; }
373
+ case 0x63: { const mod = line(), nme = line(); st.push({g: mod + "." + nme}); break; }
374
+ case 0x93: { const nme = st.pop(), mod = st.pop(); st.push({g: mod + "." + nme}); break; }
375
+ case 0x74: st.push(popMark()); break;
376
+ case 0x85: st.push([st.pop()]); break;
377
+ case 0x86: { const y = st.pop(), x = st.pop(); st.push([x, y]); break; }
378
+ case 0x87: { const z = st.pop(), y = st.pop(), x = st.pop(); st.push([x, y, z]); break; }
379
+ case 0x73: { const v = st.pop(), k = st.pop(); st[st.length - 1].set(k, v); break; }
380
+ case 0x75: { const it = popMark(), d = st[st.length - 1]; for(let k = 0; k < it.length; k += 2) d.set(it[k], it[k + 1]); break; }
381
+ case 0x61: { const v = st.pop(); st[st.length - 1].push(v); break; }
382
+ case 0x65: { const it = popMark(); st[st.length - 1].push(...it); break; }
383
+ case 0x52: { const args = st.pop(), fn = st.pop(); st.push(ptGlobal(fn, args)); break; }
384
+ case 0x51: { // BINPERSID: ("storage", StorageClass, key, location, numel)
385
+ const pid = st.pop(), cls = pid[1] && pid[1].g ? pid[1].g.split(".").pop() : "";
386
+ if(pid[0] !== "storage" || !PT_TYPES[cls]) throw new Error("Unsupported tensor storage in .pt file (" + cls + ").");
387
+ st.push({storage:true, cls, key:String(pid[2]), numel:pid[4]}); break; }
388
+ case 0x62: st.pop(); break; // BUILD: attributes such as _metadata are ignored
389
+ case 0x2e: return st.pop();
390
+ default: throw new Error("Unsupported pickle opcode 0x" + op.toString(16) + " in .pt file.");
391
+ }
392
+ }
393
+ }
394
+ async function readPt(buf){
395
+ const zip = await readZip(buf);
396
+ const pkl = [...zip.files.keys()].find(n => n.endsWith("data.pkl"));
397
+ if(!pkl) throw new Error(zip.files.has("constants.pkl") || [...zip.files.keys()].some(n => n.includes("/code/")) ? "TorchScript files can’t be read. Save a plain state_dict instead." : "No data.pkl found: not a PyTorch checkpoint.");
398
+ const root = unpickle(await zip.get(pkl)), prefix = pkl.slice(0, -"data.pkl".length);
399
+ const cache = new Map(), out = new Map();
400
+ const storageData = async (sd) => {
401
+ if(!cache.has(sd.key)){
402
+ const bytes = await zip.get(prefix + "data/" + sd.key), Arr = PT_TYPES[sd.cls][1];
403
+ const aligned = bytes.byteOffset % Arr.BYTES_PER_ELEMENT === 0;
404
+ const src = aligned ? bytes : bytes.slice();
405
+ cache.set(sd.key, new Arr(src.buffer, src.byteOffset, Math.floor(src.byteLength / Arr.BYTES_PER_ELEMENT)));
406
+ }
407
+ return cache.get(sd.key);
408
+ };
409
+ const leaf = async (t) => {
410
+ const arr = await storageData(t.storage), shape = t.shape, stride = t.stride;
411
+ const numel = shape.reduce((a, b) => a * b, 1);
412
+ let dense = true, acc = 1;
413
+ for(let d = shape.length - 1; d >= 0; d--){ if(shape[d] !== 1 && stride[d] !== acc) dense = false; acc *= shape[d]; }
414
+ let data;
415
+ if(dense) data = arr.subarray(t.offset, t.offset + numel);
416
+ else{
417
+ data = new arr.constructor(numel); const idx = new Array(shape.length).fill(0);
418
+ for(let n = 0; n < numel; n++){
419
+ let p = t.offset; for(let d = 0; d < shape.length; d++) p += idx[d] * stride[d];
420
+ data[n] = arr[p];
421
+ for(let d = shape.length - 1; d >= 0; d--){ if(++idx[d] < shape[d]) break; idx[d] = 0; }
422
+ }
423
+ }
424
+ return {shape, dtype:PT_TYPES[t.storage.cls][0], data};
425
+ };
426
+ const walk = async (node, path) => {
427
+ if(node && node.tensor) out.set(path, await leaf(node));
428
+ else if(node instanceof Map) for(const [k, v] of node) if(k !== "_metadata") await walk(v, path ? path + "." + k : String(k));
429
+ };
430
+ await walk(root, "");
431
+ for(const pre of ["state_dict.", "model."]) if(out.size && [...out.keys()].every(k => k.startsWith(pre))){
432
+ const re = new Map(); for(const [k, v] of out) re.set(k.slice(pre.length), v); return re;
433
+ }
434
+ return out;
435
+ }
436
+ function toFloat32(t){
437
+ const d = t.data;
438
+ if(t.dtype === "float32") return d;
439
+ if(t.dtype === "bfloat16"){ const u = new Uint32Array(d.length); for(let i = 0; i < d.length; i++) u[i] = d[i] << 16; return new Float32Array(u.buffer); }
440
+ if(t.dtype === "float16"){
441
+ const f = new Float32Array(d.length);
442
+ for(let i = 0; i < d.length; i++){
443
+ const h = d[i], e = (h >> 10) & 31, m = h & 1023, sg = h & 0x8000 ? -1 : 1;
444
+ f[i] = e === 0 ? sg * m * 5.960464477539063e-8 : e === 31 ? (m ? NaN : sg * Infinity) : sg * (1 + m / 1024) * Math.pow(2, e - 15);
445
+ }
446
+ return f;
447
+ }
448
+ return Float32Array.from(d, Number);
449
+ }
450
+ async function fetchBuffer(url, onProgress){
451
+ const r = await fetch(url); if(!r.ok) throw new Error("Download failed (" + r.status + "): " + url);
452
+ const total = +r.headers.get("content-length") || 0;
453
+ if(!r.body) return r.arrayBuffer();
454
+ const rd = r.body.getReader();
455
+ let got = 0;
456
+ if(total){ // size known: write straight into one buffer, so memory peaks at 1x the file size instead of 2x
457
+ const out = new Uint8Array(total);
458
+ for(;;){
459
+ const {done, value} = await rd.read(); if(done) break;
460
+ if(got + value.length > total) throw new Error("Download larger than announced size.");
461
+ out.set(value, got); got += value.length; if(onProgress) onProgress(got / total * 100);
462
+ }
463
+ if(got !== total) throw new Error("Download was cut off (" + got + " of " + total + " bytes). Please try again.");
464
+ return out.buffer;
465
+ }
466
+ const chunks = [];
467
+ for(;;){ const {done, value} = await rd.read(); if(done) break; chunks.push(value); got += value.length; }
468
+ const out = new Uint8Array(got); let o = 0; for(const c of chunks){ out.set(c, o); o += c.length; }
469
+ return out.buffer;
470
+ }
471
+
472
+ /* ---- safetensors reader ---- */
473
+ const ST_TYPES = {F32:["float32",Float32Array],F64:["float64",Float64Array],F16:["float16",Uint16Array],BF16:["bfloat16",Uint16Array],I64:["int64",BigInt64Array],I32:["int32",Int32Array],I16:["int16",Int16Array],I8:["int8",Int8Array],U8:["uint8",Uint8Array],BOOL:["bool",Uint8Array]};
474
+ function readSafetensors(buf){
475
+ const dv = new DataView(buf), n = Number(dv.getBigUint64(0, true));
476
+ if(!(n > 0) || n > buf.byteLength - 8) throw new Error("Not a safetensors file.");
477
+ const head = JSON.parse(new TextDecoder().decode(new Uint8Array(buf, 8, n))), base = 8 + n, out = new Map();
478
+ for(const [name, info] of Object.entries(head)){
479
+ if(name === "__metadata__") continue;
480
+ const ty = ST_TYPES[info.dtype]; if(!ty) throw new Error("Unsupported safetensors dtype " + info.dtype);
481
+ const [a, b] = info.data_offsets, Arr = ty[1];
482
+ let data;
483
+ if((base + a) % Arr.BYTES_PER_ELEMENT === 0) data = new Arr(buf, base + a, (b - a) / Arr.BYTES_PER_ELEMENT);
484
+ else data = new Arr(buf.slice(base + a, base + b));
485
+ out.set(name, {shape:info.shape, dtype:ty[0], data});
486
+ }
487
+ return out;
488
+ }
489
+
490
+ /* ---- run in browser ---- */
491
+ let current = null; const engines = new Map(); let lib = null;
492
+ function openRun(m){
493
+ current = m;
494
+ $("#rname").textContent = m.id;
495
+ $("#rout").hidden = true; $("#rout").textContent = "";
496
+ $("#rstat").textContent = navigator.gpu ? t("sGpu") : t("sNoGpu");
497
+ $("#rgo").disabled = false;
498
+ $("#dlg").showModal();
499
+ }
500
+ $("#rclose").onclick = () => $("#dlg").close();
501
+
502
+ // Returns a function (prompt, onToken) => Promise for the model, loading it on first use.
503
+ async function getEngine(m, stat){
504
+ if(engines.has(m.id)) return engines.get(m.id);
505
+ const pct = p => typeof p === "number" ? " " + Math.round(p) + "%" : "";
506
+ let eng;
507
+ if(m.runtime === "custom"){
508
+ const mf = m.manifest || {}, base = "https://huggingface.co/" + m.id + "/resolve/main/";
509
+ const onProgress = (p, msg) => { stat.textContent = t("sLoad") + (msg ? " (" + msg + ")" : "") + pct(p); };
510
+ stat.textContent = t("sLoad") + "...";
511
+ const code = await (await fetch(base + (mf.runner || "verolm-runner.js"))).text();
512
+ const mod = await import(URL.createObjectURL(new Blob([code], {type:"text/javascript"})));
513
+ const ctx = {modelId:m.id, baseUrl:base, manifest:mf, onProgress, tools:{readPt, readSafetensors, fetchBuffer, toFloat32}};
514
+ if(mf.weights){
515
+ const buf = await fetchBuffer(base + mf.weights, p => onProgress(p, "weights"));
516
+ if(mf.format === "pt"){ onProgress(undefined, "reading .pt"); ctx.tensors = await readPt(buf); }
517
+ else if(mf.format === "safetensors"){ ctx.tensors = readSafetensors(buf); }
518
+ else ctx.weights = buf;
519
+ }
520
+ const r = await mod.load(ctx);
521
+ eng = (prompt, onToken) => r.generate(prompt, {onToken, maxTokens:mf.maxTokens || 256});
522
+ }else{
523
+ if(!lib) lib = await import("https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.2");
524
+ stat.textContent = t("sLoad") + "...";
525
+ const gpu = !!navigator.gpu, has = n => (m.onnxFiles || []).includes("onnx/" + n);
526
+ const dtype = gpu
527
+ ? (has("model_q4.onnx") ? "q4" : has("model_fp16.onnx") ? "fp16" : has("model_quantized.onnx") ? "q8" : "fp32")
528
+ : (has("model_quantized.onnx") ? "q8" : has("model_q4.onnx") ? "q4" : "fp32");
529
+ const gen = await lib.pipeline("text-generation", m.id, {
530
+ device: gpu ? "webgpu" : "wasm",
531
+ dtype,
532
+ progress_callback: p => { if(p.status === "progress") stat.textContent = t("sLoad") + pct(p.progress || 0); }
533
+ });
534
+ eng = async (prompt, onToken) => {
535
+ const streamer = new lib.TextStreamer(gen.tokenizer, {skip_prompt:true, callback_function:onToken});
536
+ await gen([{role:"user", content:prompt}], {max_new_tokens:256, do_sample:false, streamer});
537
+ };
538
+ }
539
+ engines.set(m.id, eng);
540
+ return eng;
541
+ }
542
+
543
+ $("#rgo").onclick = async () => {
544
+ const go = $("#rgo"), out = $("#rout"), stat = $("#rstat");
545
+ const prompt = $("#rin").value.trim();
546
+ if(!prompt) return;
547
+ go.disabled = true; out.hidden = false; out.textContent = "";
548
+ try{
549
+ const eng = await getEngine(current, stat);
550
+ stat.textContent = t("sGen");
551
+ await eng(prompt, s => { out.textContent += s; });
552
+ stat.textContent = t("sReady");
553
+ }catch(e){
554
+ console.error(e);
555
+ engines.delete(current.id);
556
+ const detail = String((e && e.message) || e).slice(0, 220);
557
+ stat.textContent = (current.runtime === "custom" ? t("sErrCustom") : t("sErr")) + " [" + detail + "]";
558
+ }
559
+ go.disabled = false;
560
+ };
561
+
562
+ applyLang();
563
+ load();
564
+ </script>
565
+ </body>
566
+ </html>