Spaces:
Running on Zero
Running on Zero
Update index.html
Browse files- index.html +195 -37
index.html
CHANGED
|
@@ -160,10 +160,44 @@ input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.2);}
|
|
| 160 |
.think-body{margin-top:7px;display:none;border-top:1px solid rgba(13,148,136,.15);padding-top:7px;font-size:12px;color:var(--ink3);line-height:1.6;}
|
| 161 |
.think-blk.open .think-body{display:block;}
|
| 162 |
|
| 163 |
-
.bubble pre{background:#0d1117;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:10px 12px;margin:7px 0;overflow-x:auto;font-family:var(--fm);font-size:11.5px;line-height:1.6;}
|
| 164 |
.bubble code{font-family:var(--fm);font-size:11.5px;background:var(--fog);padding:1px 5px;border-radius:4px;}
|
| 165 |
.bubble pre code{background:transparent;padding:0;}
|
| 166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
.typing{display:flex;align-items:center;gap:5px;padding:12px 15px;}
|
| 168 |
.typing span{width:6px;height:6px;border-radius:50%;background:var(--v2);opacity:.4;animation:bounce .8s ease-in-out infinite;}
|
| 169 |
.typing span:nth-child(2){animation-delay:.15s;}
|
|
@@ -240,6 +274,16 @@ input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.2);}
|
|
| 240 |
</div>
|
| 241 |
<div class="mc-desc">MRI-guided evolutionary merge Β· Surpassed both parents Β· 201 languages Β· 262K context</div>
|
| 242 |
<a href="https://huggingface.co/FINAL-Bench/Darwin-35B-A3B-Opus" target="_blank" style="display:inline-flex;align-items:center;gap:5px;margin-top:8px;font-size:10px;font-weight:700;color:var(--v);text-decoration:none;padding:4px 10px;border-radius:16px;background:var(--vg);border:1px solid rgba(109,40,217,.15);transition:all .2s;">π€ Model Card β</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
</div>
|
| 244 |
|
| 245 |
<!-- Settings -->
|
|
@@ -291,6 +335,9 @@ input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.2);}
|
|
| 291 |
</div>
|
| 292 |
<div style="display:flex;align-items:center;gap:12px;">
|
| 293 |
<a href="https://huggingface.co/FINAL-Bench/Darwin-35B-A3B-Opus" target="_blank" style="display:inline-flex;align-items:center;gap:6px;padding:5px 14px;border-radius:22px;background:linear-gradient(135deg,rgba(109,40,217,.1),rgba(16,185,129,.08));border:1.5px solid rgba(109,40,217,.25);color:var(--v);font-size:12px;font-weight:700;text-decoration:none;transition:all .22s;font-family:var(--fm);">π€ Model Card β</a>
|
|
|
|
|
|
|
|
|
|
| 294 |
<a class="hf-login-btn" id="loginBtn" href="/oauth/login">
|
| 295 |
<svg viewBox="0 0 120 120" width="16" height="16"><path fill="currentColor" d="M41.7 56.6c-5 0-8.8 4-8.8 9s3.8 9 8.8 9 8.8-4 8.8-9-3.8-9-8.8-9zm36.6 0c-5 0-8.8 4-8.8 9s3.8 9 8.8 9 8.8-4 8.8-9-3.8-9-8.8-9z"/></svg>
|
| 296 |
Sign in with HF
|
|
@@ -328,17 +375,28 @@ input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.2);}
|
|
| 328 |
<div class="ex-grid">
|
| 329 |
<div class="ex-card" onclick="sendEx('Explain how Darwin V5 evolutionary merge with Model MRI works, and why it surpasses both parent models.')"><span class="ex-icon">π§¬</span><div class="ex-title">Darwin Architecture</div><div class="ex-desc">How evolutionary merge works</div></div>
|
| 330 |
<div class="ex-card" onclick="sendEx('Write a Python async web scraper with retry logic and rate limiting. Include type hints.')"><span class="ex-icon">π»</span><div class="ex-title">Code Generation</div><div class="ex-desc">Production-quality code</div></div>
|
| 331 |
-
<div class="ex-card" onclick="
|
| 332 |
<div class="ex-card" onclick="sendEx('νκ΅μ K-popμ΄ μΈκ³μ μΌλ‘ μ±κ³΅ν μ΄μ λ₯Ό λ¬Ένμ , κ²½μ μ κ΄μ μμ λΆμν΄μ£ΌμΈμ.')"><span class="ex-icon">π</span><div class="ex-title">201 Languages</div><div class="ex-desc">Korean, Japanese, Arabicβ¦</div></div>
|
| 333 |
</div>
|
| 334 |
</div>
|
| 335 |
</div>
|
| 336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
<div class="inputbar">
|
| 338 |
<div class="input-wrap">
|
| 339 |
<textarea class="chat-ta" id="chatInput" placeholder="Message Darwinβ¦" rows="1" onkeydown="handleKey(event)" oninput="autoGrow(this)"></textarea>
|
| 340 |
<div class="input-acts">
|
| 341 |
-
<label class="icon-btn file-btn" id="fileLabel" title="Upload image">πΌ<input type="file" accept="image/*" onchange="
|
|
|
|
| 342 |
<button class="icon-btn" onclick="clearChat()" title="New chat" style="font-size:16px;">π§¬</button>
|
| 343 |
<button class="send-btn" id="sendBtn" onclick="sendMsg()">β€</button>
|
| 344 |
</div>
|
|
@@ -355,7 +413,7 @@ input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.2);}
|
|
| 355 |
<div class="toast" id="toast"></div>
|
| 356 |
|
| 357 |
<script>
|
| 358 |
-
const S={vision:true,history:[],msgCount:0,totalTok:0,pending:null,busy:false,
|
| 359 |
presets:{
|
| 360 |
general:'You are Darwin-35B-A3B-Opus, a highly capable reasoning model created by VIDRAFT via evolutionary merge. Think step by step for complex questions.',
|
| 361 |
code:'You are an expert software engineer. Write clean, efficient, well-commented code. Explain your approach before writing.',
|
|
@@ -379,22 +437,87 @@ document.getElementById('visionToggle').addEventListener('change',function(){
|
|
| 379 |
|
| 380 |
function setPreset(k){document.getElementById('sysPrompt').value=S.presets[k];showToast('Preset applied β');}
|
| 381 |
|
| 382 |
-
//
|
| 383 |
-
function
|
| 384 |
const f=input.files[0];if(!f)return;
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
}
|
| 395 |
-
function removeImg(){S.pending=null;document.getElementById('imgPrev').classList.remove('show');document.getElementById('fileInput').value='';}
|
| 396 |
function fmtSz(b){return b<1048576?`${(b/1024).toFixed(0)} KB`:`${(b/1048576).toFixed(1)} MB`;}
|
| 397 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
// Send
|
| 399 |
function handleKey(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMsg();}}
|
| 400 |
function autoGrow(el){el.style.height='auto';el.style.height=Math.min(el.scrollHeight,150)+'px';}
|
|
@@ -410,11 +533,25 @@ async function sendMsg(){
|
|
| 410 |
|
| 411 |
const imgSnap=S.pending?{...S.pending}:null;
|
| 412 |
removeImg();
|
| 413 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
|
| 415 |
const payload=[
|
| 416 |
-
|
| 417 |
-
|
| 418 |
document.getElementById('sysPrompt').value.trim()||S.presets.general,
|
| 419 |
parseInt(document.getElementById('tokSl').value),
|
| 420 |
parseFloat(document.getElementById('tempSl').value),
|
|
@@ -439,9 +576,12 @@ async function sendMsg(){
|
|
| 439 |
|
| 440 |
const finish=text=>{
|
| 441 |
if(done)return;done=true;es.close();
|
| 442 |
-
|
|
|
|
|
|
|
|
|
|
| 443 |
S.history.push([msg,stripThink(text)]);
|
| 444 |
-
S.msgCount+=2;S.totalTok+=
|
| 445 |
updateStats();
|
| 446 |
resolve();
|
| 447 |
};
|
|
@@ -470,19 +610,21 @@ async function sendMsg(){
|
|
| 470 |
function sendEx(t){document.getElementById('chatInput').value=t;sendMsg();}
|
| 471 |
function hideWelcome(){const w=document.getElementById('welcome');if(w){w.style.transition='opacity .25s';w.style.opacity='0';setTimeout(()=>w.remove(),260);}}
|
| 472 |
|
| 473 |
-
function appendUser(text,img){
|
| 474 |
const t=new Date().toLocaleTimeString('en',{hour:'2-digit',minute:'2-digit'});
|
| 475 |
-
|
|
|
|
|
|
|
| 476 |
const el=document.createElement('div');
|
| 477 |
el.className='msg user';
|
| 478 |
-
el.innerHTML=`<div class="avatar">U</div><div class="body">${
|
| 479 |
document.getElementById('msgs').appendChild(el);
|
| 480 |
scrollDown();
|
| 481 |
}
|
| 482 |
function appendBot(){
|
| 483 |
const el=document.createElement('div');
|
| 484 |
el.className='msg bot';
|
| 485 |
-
el.innerHTML='<div class="avatar">π§¬</div><div class="body"><div class="bubble"><div class="typing"><span></span><span></span><span></span></div></div><div class="msg-time">β</div></div>';
|
| 486 |
document.getElementById('msgs').appendChild(el);
|
| 487 |
scrollDown();return el;
|
| 488 |
}
|
|
@@ -511,38 +653,44 @@ function splitThinkAnswer(raw){
|
|
| 511 |
return['',raw];
|
| 512 |
}
|
| 513 |
|
| 514 |
-
function renderBot(el,raw){
|
| 515 |
const t=new Date().toLocaleTimeString('en',{hour:'2-digit',minute:'2-digit'});
|
| 516 |
el.querySelector('.msg-time').textContent=t;
|
| 517 |
const b=el.querySelector('.bubble');
|
| 518 |
-
|
|
|
|
| 519 |
const tOpen=raw.indexOf('<think>'),tClose=raw.indexOf('</think>');
|
| 520 |
const dOpen=raw.indexOf('<details>'),sClose=raw.indexOf('</summary>'),dClose=raw.indexOf('</details>');
|
| 521 |
|
| 522 |
if(tOpen>=0&&tClose>tOpen){
|
| 523 |
const chain=raw.slice(tOpen+7,tClose).trim();ans=raw.slice(tClose+8).trim();
|
| 524 |
-
thinkHtml=buildThink(chain);
|
| 525 |
}else if(tOpen>=0){
|
| 526 |
const thinkLen=raw.length-tOpen-7;ans='';
|
| 527 |
thinkHtml=`<div class="think-blk"><div class="think-hdr" style="cursor:default;">π§ REASONING (${thinkLen} CHARS) <span class="typing" style="display:inline-flex;gap:4px;vertical-align:middle;margin-left:6px;"><span></span><span></span><span></span></span></div></div>`;
|
| 528 |
}else if(dOpen>=0&&sClose>dOpen){
|
| 529 |
const body=dClose>sClose?raw.slice(sClose+10,dClose):raw.slice(sClose+10);
|
| 530 |
const chain=body.replace(/^> ?/gm,'').replace(/<[^>]+>/g,'').trim();
|
| 531 |
-
ans=dClose>0?raw.slice(dClose+10).trim():'';thinkHtml=buildThink(chain);
|
| 532 |
}else{
|
| 533 |
-
// Plain-text thinking detection
|
| 534 |
const firstLine=raw.trim().split('\n')[0]||'';
|
| 535 |
if(isThinkLine(firstLine)&&raw.length>20){
|
| 536 |
const[think,answer]=splitThinkAnswer(raw);
|
| 537 |
-
if(think&&answer){
|
| 538 |
-
|
| 539 |
-
}else if(think&&!answer){
|
| 540 |
ans='';
|
| 541 |
thinkHtml=`<div class="think-blk"><div class="think-hdr" style="cursor:default;">π§ REASONING (${raw.length} CHARS) <span class="typing" style="display:inline-flex;gap:4px;vertical-align:middle;margin-left:6px;"><span></span><span></span><span></span></span></div></div>`;
|
| 542 |
}
|
| 543 |
}
|
| 544 |
}
|
| 545 |
b.innerHTML=thinkHtml+md(ans);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 546 |
}
|
| 547 |
function buildThink(chain){
|
| 548 |
if(!chain)return'';
|
|
@@ -555,21 +703,31 @@ function stripThink(t){
|
|
| 555 |
return t;
|
| 556 |
}
|
| 557 |
|
| 558 |
-
// Marked.js
|
| 559 |
(function setupMarked(){
|
| 560 |
if(typeof marked==='undefined')return;
|
| 561 |
const renderer=new marked.Renderer();
|
| 562 |
renderer.code=(code,lang)=>{
|
| 563 |
const language=lang&&hljs.getLanguage(lang)?lang:'plaintext';
|
| 564 |
-
const
|
| 565 |
-
const
|
| 566 |
-
|
|
|
|
|
|
|
| 567 |
};
|
| 568 |
renderer.codespan=code=>`<code style="background:var(--fog);padding:1px 5px;border-radius:4px;font-family:var(--fm);font-size:11.5px">${code}</code>`;
|
| 569 |
renderer.link=(href,title,text)=>`<a href="${typeof href==='object'?href.href:href}" target="_blank" rel="noopener">${text}</a>`;
|
| 570 |
marked.setOptions({renderer,breaks:true,gfm:true});
|
| 571 |
})();
|
| 572 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 573 |
function md(t){if(!t)return'';if(typeof marked!=='undefined'){try{return marked.parse(t);}catch(e){}}return t.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/`([^`]+)`/g,'<code>$1</code>').replace(/\*\*(.+?)\*\*/g,'<strong>$1</strong>').replace(/\n/g,'<br>');}
|
| 574 |
function esc(t){return t?t.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'):'';}
|
| 575 |
function scrollDown(){const m=document.getElementById('msgs');m.scrollTop=m.scrollHeight;}
|
|
|
|
| 160 |
.think-body{margin-top:7px;display:none;border-top:1px solid rgba(13,148,136,.15);padding-top:7px;font-size:12px;color:var(--ink3);line-height:1.6;}
|
| 161 |
.think-blk.open .think-body{display:block;}
|
| 162 |
|
| 163 |
+
.bubble pre{background:#0d1117;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:10px 12px;margin:7px 0;overflow-x:auto;font-family:var(--fm);font-size:11.5px;line-height:1.6;position:relative;}
|
| 164 |
.bubble code{font-family:var(--fm);font-size:11.5px;background:var(--fog);padding:1px 5px;border-radius:4px;}
|
| 165 |
.bubble pre code{background:transparent;padding:0;}
|
| 166 |
|
| 167 |
+
/* Code copy button */
|
| 168 |
+
.code-wrap{position:relative;margin:7px 0;}
|
| 169 |
+
.code-wrap pre{margin:0;}
|
| 170 |
+
.code-header{display:flex;justify-content:space-between;align-items:center;padding:6px 14px;background:#161b22;border-radius:8px 8px 0 0;border:1px solid rgba(255,255,255,.08);border-bottom:none;}
|
| 171 |
+
.code-lang-tag{font-size:11px;font-weight:600;color:#8b949e;font-family:var(--fm);}
|
| 172 |
+
.copy-btn{padding:3px 10px;border-radius:6px;border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.05);color:#8b949e;font-size:10px;font-weight:600;cursor:pointer;font-family:var(--fm);transition:all .2s;}
|
| 173 |
+
.copy-btn:hover{background:rgba(255,255,255,.12);color:#c9d1d9;}
|
| 174 |
+
.copy-btn.copied{background:rgba(22,163,74,.15);color:#16a34a;border-color:rgba(22,163,74,.3);}
|
| 175 |
+
.code-wrap pre{border-radius:0 0 8px 8px;}
|
| 176 |
+
|
| 177 |
+
/* Response speed badge */
|
| 178 |
+
.speed-badge{display:inline-flex;align-items:center;gap:5px;margin-top:4px;padding:2px 8px;border-radius:12px;background:rgba(109,40,217,.06);border:1px solid rgba(109,40,217,.12);font-size:9px;font-weight:600;font-family:var(--fm);color:var(--v);}
|
| 179 |
+
|
| 180 |
+
/* Reasoning depth badge */
|
| 181 |
+
.reason-badge{display:inline-flex;align-items:center;gap:4px;margin-left:6px;padding:2px 8px;border-radius:12px;background:rgba(13,148,136,.06);border:1px solid rgba(13,148,136,.15);font-size:9px;font-weight:600;font-family:var(--fm);color:var(--teal);}
|
| 182 |
+
|
| 183 |
+
/* Search bar */
|
| 184 |
+
.search-bar{display:none;padding:8px 18px 0;}
|
| 185 |
+
.search-bar.show{display:block;}
|
| 186 |
+
.search-wrap{display:flex;gap:6px;align-items:center;}
|
| 187 |
+
.search-input{flex:1;padding:7px 12px;border-radius:var(--r-xs);border:1.5px solid var(--line);background:var(--fog);font-family:var(--fb);font-size:12px;color:var(--ink);outline:none;transition:border-color .2s;}
|
| 188 |
+
.search-input:focus{border-color:rgba(109,40,217,.35);}
|
| 189 |
+
.search-go{padding:7px 14px;border-radius:var(--r-xs);border:none;background:linear-gradient(135deg,#6d28d9,#7c3aed);color:#fff;font-size:11px;font-weight:700;cursor:pointer;font-family:var(--fb);}
|
| 190 |
+
.search-results{margin-top:6px;padding:8px 10px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-xs);font-size:11px;max-height:150px;overflow-y:auto;display:none;}
|
| 191 |
+
.search-results.show{display:block;}
|
| 192 |
+
.sr-item{padding:4px 0;border-bottom:1px solid var(--fog);}
|
| 193 |
+
.sr-item:last-child{border:none;}
|
| 194 |
+
.sr-title{font-weight:700;color:var(--ink);font-size:11px;}
|
| 195 |
+
.sr-desc{color:var(--ink3);font-size:10px;line-height:1.4;}
|
| 196 |
+
.sr-url{color:var(--v);font-size:9px;text-decoration:none;}
|
| 197 |
+
|
| 198 |
+
/* PDF indicator */
|
| 199 |
+
.pdf-badge{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:6px;background:rgba(225,29,72,.06);border:1px solid rgba(225,29,72,.15);font-size:10px;font-weight:600;color:var(--rose);}
|
| 200 |
+
|
| 201 |
.typing{display:flex;align-items:center;gap:5px;padding:12px 15px;}
|
| 202 |
.typing span{width:6px;height:6px;border-radius:50%;background:var(--v2);opacity:.4;animation:bounce .8s ease-in-out infinite;}
|
| 203 |
.typing span:nth-child(2){animation-delay:.15s;}
|
|
|
|
| 274 |
</div>
|
| 275 |
<div class="mc-desc">MRI-guided evolutionary merge Β· Surpassed both parents Β· 201 languages Β· 262K context</div>
|
| 276 |
<a href="https://huggingface.co/FINAL-Bench/Darwin-35B-A3B-Opus" target="_blank" style="display:inline-flex;align-items:center;gap:5px;margin-top:8px;font-size:10px;font-weight:700;color:var(--v);text-decoration:none;padding:4px 10px;border-radius:16px;background:var(--vg);border:1px solid rgba(109,40,217,.15);transition:all .2s;">π€ Model Card β</a>
|
| 277 |
+
<div style="display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;">
|
| 278 |
+
<a href="https://huggingface.co/spaces/FINAL-Bench/Leaderboard" target="_blank" style="display:inline-flex;align-items:center;gap:3px;font-size:8px;font-weight:700;color:#059669;text-decoration:none;padding:3px 8px;border-radius:12px;background:rgba(16,185,129,.08);border:1px solid rgba(16,185,129,.15);transition:all .2s;">π FINAL Bench</a>
|
| 279 |
+
<a href="https://huggingface.co/spaces/FINAL-Bench/all-bench-leaderboard" target="_blank" style="display:inline-flex;align-items:center;gap:3px;font-size:8px;font-weight:700;color:var(--amber);text-decoration:none;padding:3px 8px;border-radius:12px;background:rgba(217,119,6,.08);border:1px solid rgba(217,119,6,.15);transition:all .2s;">π ALL Bench</a>
|
| 280 |
+
<a href="https://huggingface.co/spaces/MAYA-AI/all-leaderboard" target="_blank" style="display:inline-flex;align-items:center;gap:3px;font-size:8px;font-weight:700;color:var(--v);text-decoration:none;padding:3px 8px;border-radius:12px;background:rgba(109,40,217,.06);border:1px solid rgba(109,40,217,.12);transition:all .2s;">π MAYA LB</a>
|
| 281 |
+
</div>
|
| 282 |
+
<div style="display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;">
|
| 283 |
+
<a href="https://huggingface.co/spaces/FINAL-Bench/Leaderboard" target="_blank" style="font-size:8px;font-weight:700;padding:2px 7px;border-radius:10px;background:rgba(22,163,74,.08);border:1px solid rgba(22,163,74,.18);color:#16a34a;text-decoration:none;transition:all .2s;">π FINAL Bench</a>
|
| 284 |
+
<a href="https://huggingface.co/spaces/FINAL-Bench/all-bench-leaderboard" target="_blank" style="font-size:8px;font-weight:700;padding:2px 7px;border-radius:10px;background:rgba(217,119,6,.08);border:1px solid rgba(217,119,6,.18);color:#d97706;text-decoration:none;transition:all .2s;">π ALL Bench</a>
|
| 285 |
+
<a href="https://huggingface.co/spaces/MAYA-AI/all-leaderboard" target="_blank" style="font-size:8px;font-weight:700;padding:2px 7px;border-radius:10px;background:rgba(109,40,217,.08);border:1px solid rgba(109,40,217,.18);color:var(--v);text-decoration:none;transition:all .2s;">π MAYA LB</a>
|
| 286 |
+
</div>
|
| 287 |
</div>
|
| 288 |
|
| 289 |
<!-- Settings -->
|
|
|
|
| 335 |
</div>
|
| 336 |
<div style="display:flex;align-items:center;gap:12px;">
|
| 337 |
<a href="https://huggingface.co/FINAL-Bench/Darwin-35B-A3B-Opus" target="_blank" style="display:inline-flex;align-items:center;gap:6px;padding:5px 14px;border-radius:22px;background:linear-gradient(135deg,rgba(109,40,217,.1),rgba(16,185,129,.08));border:1.5px solid rgba(109,40,217,.25);color:var(--v);font-size:12px;font-weight:700;text-decoration:none;transition:all .22s;font-family:var(--fm);">π€ Model Card β</a>
|
| 338 |
+
<a href="https://huggingface.co/spaces/FINAL-Bench/Leaderboard" target="_blank" style="padding:4px 9px;border-radius:14px;background:rgba(22,163,74,.08);border:1px solid rgba(22,163,74,.18);color:#16a34a;font-size:9px;font-weight:700;text-decoration:none;font-family:var(--fm);">π FINAL</a>
|
| 339 |
+
<a href="https://huggingface.co/spaces/FINAL-Bench/all-bench-leaderboard" target="_blank" style="padding:4px 9px;border-radius:14px;background:rgba(217,119,6,.08);border:1px solid rgba(217,119,6,.18);color:#d97706;font-size:9px;font-weight:700;text-decoration:none;font-family:var(--fm);">π ALL</a>
|
| 340 |
+
<a href="https://huggingface.co/spaces/MAYA-AI/all-leaderboard" target="_blank" style="padding:4px 9px;border-radius:14px;background:rgba(109,40,217,.08);border:1px solid rgba(109,40,217,.18);color:var(--v);font-size:9px;font-weight:700;text-decoration:none;font-family:var(--fm);">π MAYA</a>
|
| 341 |
<a class="hf-login-btn" id="loginBtn" href="/oauth/login">
|
| 342 |
<svg viewBox="0 0 120 120" width="16" height="16"><path fill="currentColor" d="M41.7 56.6c-5 0-8.8 4-8.8 9s3.8 9 8.8 9 8.8-4 8.8-9-3.8-9-8.8-9zm36.6 0c-5 0-8.8 4-8.8 9s3.8 9 8.8 9 8.8-4 8.8-9-3.8-9-8.8-9z"/></svg>
|
| 343 |
Sign in with HF
|
|
|
|
| 375 |
<div class="ex-grid">
|
| 376 |
<div class="ex-card" onclick="sendEx('Explain how Darwin V5 evolutionary merge with Model MRI works, and why it surpasses both parent models.')"><span class="ex-icon">π§¬</span><div class="ex-title">Darwin Architecture</div><div class="ex-desc">How evolutionary merge works</div></div>
|
| 377 |
<div class="ex-card" onclick="sendEx('Write a Python async web scraper with retry logic and rate limiting. Include type hints.')"><span class="ex-icon">π»</span><div class="ex-title">Code Generation</div><div class="ex-desc">Production-quality code</div></div>
|
| 378 |
+
<div class="ex-card" onclick="trySampleVision()"><span class="ex-icon">ποΈ</span><div class="ex-title">Vision Demo</div><div class="ex-desc">Try image analysis now</div></div>
|
| 379 |
<div class="ex-card" onclick="sendEx('νκ΅μ K-popμ΄ μΈκ³μ μΌλ‘ μ±κ³΅ν μ΄μ λ₯Ό λ¬Ένμ , κ²½μ μ κ΄μ μμ λΆμν΄μ£ΌμΈμ.')"><span class="ex-icon">π</span><div class="ex-title">201 Languages</div><div class="ex-desc">Korean, Japanese, Arabicβ¦</div></div>
|
| 380 |
</div>
|
| 381 |
</div>
|
| 382 |
</div>
|
| 383 |
|
| 384 |
+
<!-- Search Bar -->
|
| 385 |
+
<div class="search-bar" id="searchBar">
|
| 386 |
+
<div class="search-wrap">
|
| 387 |
+
<input class="search-input" id="searchInput" placeholder="Search the web..." onkeydown="if(event.key==='Enter')doSearch()">
|
| 388 |
+
<button class="search-go" onclick="doSearch()">π Search</button>
|
| 389 |
+
<button class="icon-btn" onclick="toggleSearch()" style="font-size:12px;">β</button>
|
| 390 |
+
</div>
|
| 391 |
+
<div class="search-results" id="searchResults"></div>
|
| 392 |
+
</div>
|
| 393 |
+
|
| 394 |
<div class="inputbar">
|
| 395 |
<div class="input-wrap">
|
| 396 |
<textarea class="chat-ta" id="chatInput" placeholder="Message Darwinβ¦" rows="1" onkeydown="handleKey(event)" oninput="autoGrow(this)"></textarea>
|
| 397 |
<div class="input-acts">
|
| 398 |
+
<label class="icon-btn file-btn" id="fileLabel" title="Upload image or PDF">πΌ<input type="file" accept="image/*,.pdf" onchange="handleFile(this)" id="fileInput"></label>
|
| 399 |
+
<button class="icon-btn" id="searchToggleBtn" onclick="toggleSearch()" title="Web search">π</button>
|
| 400 |
<button class="icon-btn" onclick="clearChat()" title="New chat" style="font-size:16px;">π§¬</button>
|
| 401 |
<button class="send-btn" id="sendBtn" onclick="sendMsg()">β€</button>
|
| 402 |
</div>
|
|
|
|
| 413 |
<div class="toast" id="toast"></div>
|
| 414 |
|
| 415 |
<script>
|
| 416 |
+
const S={vision:true,history:[],msgCount:0,totalTok:0,pending:null,busy:false,searchResults:null,
|
| 417 |
presets:{
|
| 418 |
general:'You are Darwin-35B-A3B-Opus, a highly capable reasoning model created by VIDRAFT via evolutionary merge. Think step by step for complex questions.',
|
| 419 |
code:'You are an expert software engineer. Write clean, efficient, well-commented code. Explain your approach before writing.',
|
|
|
|
| 437 |
|
| 438 |
function setPreset(k){document.getElementById('sysPrompt').value=S.presets[k];showToast('Preset applied β');}
|
| 439 |
|
| 440 |
+
// File handling (image + PDF)
|
| 441 |
+
function handleFile(input){
|
| 442 |
const f=input.files[0];if(!f)return;
|
| 443 |
+
if(f.type==='application/pdf'){
|
| 444 |
+
// PDF handling
|
| 445 |
+
const r=new FileReader();
|
| 446 |
+
r.onload=async e=>{
|
| 447 |
+
S.pending={type:'pdf',data:e.target.result,name:f.name,size:fmtSz(f.size)};
|
| 448 |
+
document.getElementById('imgThumb').src='';
|
| 449 |
+
document.getElementById('imgThumb').style.display='none';
|
| 450 |
+
document.getElementById('imgName').textContent='π '+f.name;
|
| 451 |
+
document.getElementById('imgSize').textContent=fmtSz(f.size);
|
| 452 |
+
document.getElementById('imgPrev').classList.add('show');
|
| 453 |
+
// Extract text
|
| 454 |
+
try{
|
| 455 |
+
const res=await fetch('/api/extract-pdf',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({data:e.target.result})});
|
| 456 |
+
const data=await res.json();
|
| 457 |
+
if(data.text){S.pending.text=data.text;document.getElementById('imgSize').textContent=`${fmtSz(f.size)} Β· ${data.chars} chars extracted`;}
|
| 458 |
+
}catch(err){console.error('PDF extract failed:',err);}
|
| 459 |
+
};
|
| 460 |
+
r.readAsDataURL(f);
|
| 461 |
+
}else{
|
| 462 |
+
// Image handling
|
| 463 |
+
const r=new FileReader();
|
| 464 |
+
r.onload=e=>{
|
| 465 |
+
S.pending={type:'image',data:e.target.result,name:f.name,size:fmtSz(f.size)};
|
| 466 |
+
document.getElementById('imgThumb').src=e.target.result;
|
| 467 |
+
document.getElementById('imgThumb').style.display='block';
|
| 468 |
+
document.getElementById('imgName').textContent=f.name;
|
| 469 |
+
document.getElementById('imgSize').textContent=fmtSz(f.size);
|
| 470 |
+
document.getElementById('imgPrev').classList.add('show');
|
| 471 |
+
};
|
| 472 |
+
r.readAsDataURL(f);
|
| 473 |
+
}
|
| 474 |
}
|
| 475 |
+
function removeImg(){S.pending=null;document.getElementById('imgPrev').classList.remove('show');document.getElementById('fileInput').value='';document.getElementById('imgThumb').style.display='block';}
|
| 476 |
function fmtSz(b){return b<1048576?`${(b/1024).toFixed(0)} KB`:`${(b/1048576).toFixed(1)} MB`;}
|
| 477 |
|
| 478 |
+
// Vision sample
|
| 479 |
+
function trySampleVision(){
|
| 480 |
+
const sampleUrl='https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png';
|
| 481 |
+
S.pending={type:'image',data:sampleUrl,name:'sample_rabbit.png',size:'sample',isUrl:true};
|
| 482 |
+
document.getElementById('chatInput').value='Describe this image in detail. What story does it tell?';
|
| 483 |
+
sendMsg();
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
// Search
|
| 487 |
+
function toggleSearch(){
|
| 488 |
+
const bar=document.getElementById('searchBar');
|
| 489 |
+
bar.classList.toggle('show');
|
| 490 |
+
if(bar.classList.contains('show'))document.getElementById('searchInput').focus();
|
| 491 |
+
}
|
| 492 |
+
async function doSearch(){
|
| 493 |
+
const q=document.getElementById('searchInput').value.trim();
|
| 494 |
+
if(!q)return;
|
| 495 |
+
const res=document.getElementById('searchResults');
|
| 496 |
+
res.innerHTML='<div style="color:var(--ink4);font-size:10px;">π Searching...</div>';
|
| 497 |
+
res.classList.add('show');
|
| 498 |
+
try{
|
| 499 |
+
const r=await fetch('/api/search',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({query:q})});
|
| 500 |
+
const data=await r.json();
|
| 501 |
+
if(data.error){res.innerHTML=`<div style="color:var(--rose);font-size:10px;">β ${data.error}</div>`;return;}
|
| 502 |
+
if(!data.results||data.results.length===0){res.innerHTML='<div style="color:var(--ink4);">No results found</div>';return;}
|
| 503 |
+
let html=data.results.map(r=>`<div class="sr-item"><div class="sr-title">${esc(r.title)}</div><div class="sr-desc">${esc(r.desc)}</div><a class="sr-url" href="${r.url}" target="_blank">${r.url}</a></div>`).join('');
|
| 504 |
+
html+=`<button style="margin-top:6px;padding:4px 10px;border-radius:6px;border:1px solid var(--line);background:var(--vg);color:var(--v);font-size:10px;font-weight:600;cursor:pointer;font-family:var(--fb);" onclick="injectSearch()">π Inject into chat</button>`;
|
| 505 |
+
res.innerHTML=html;
|
| 506 |
+
S.searchResults=data.results;
|
| 507 |
+
}catch(e){res.innerHTML=`<div style="color:var(--rose);">Error: ${e.message}</div>`;}
|
| 508 |
+
}
|
| 509 |
+
function injectSearch(){
|
| 510 |
+
if(!S.searchResults)return;
|
| 511 |
+
const ctx=S.searchResults.map(r=>`β’ ${r.title}: ${r.desc}`).join('\n');
|
| 512 |
+
const inp=document.getElementById('chatInput');
|
| 513 |
+
const q=document.getElementById('searchInput').value.trim();
|
| 514 |
+
inp.value=`Based on the following web search results for "${q}":\n\n${ctx}\n\nPlease answer: ${q}`;
|
| 515 |
+
document.getElementById('searchBar').classList.remove('show');
|
| 516 |
+
document.getElementById('searchResults').classList.remove('show');
|
| 517 |
+
autoGrow(inp);
|
| 518 |
+
showToast('Search results injected β');
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
// Send
|
| 522 |
function handleKey(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMsg();}}
|
| 523 |
function autoGrow(el){el.style.height='auto';el.style.height=Math.min(el.scrollHeight,150)+'px';}
|
|
|
|
| 533 |
|
| 534 |
const imgSnap=S.pending?{...S.pending}:null;
|
| 535 |
removeImg();
|
| 536 |
+
|
| 537 |
+
// PDF: prepend extracted text to message
|
| 538 |
+
let finalMsg=msg;
|
| 539 |
+
let imgData=null;
|
| 540 |
+
if(imgSnap&&imgSnap.type==='pdf'&&imgSnap.text){
|
| 541 |
+
finalMsg=`[Document: ${imgSnap.name}]\n\n${imgSnap.text}\n\n---\n\n${msg}`;
|
| 542 |
+
appendUser(msg,null,'π '+imgSnap.name);
|
| 543 |
+
}else if(imgSnap&&imgSnap.type==='image'){
|
| 544 |
+
imgData=imgSnap.isUrl?null:imgSnap.data; // URL images handled differently
|
| 545 |
+
appendUser(msg,imgSnap);
|
| 546 |
+
}else{
|
| 547 |
+
appendUser(msg);
|
| 548 |
+
}
|
| 549 |
+
|
| 550 |
+
const startTime=performance.now();
|
| 551 |
|
| 552 |
const payload=[
|
| 553 |
+
finalMsg,S.history,'β‘ Fast Mode (direct answer)',
|
| 554 |
+
imgData,
|
| 555 |
document.getElementById('sysPrompt').value.trim()||S.presets.general,
|
| 556 |
parseInt(document.getElementById('tokSl').value),
|
| 557 |
parseFloat(document.getElementById('tempSl').value),
|
|
|
|
| 576 |
|
| 577 |
const finish=text=>{
|
| 578 |
if(done)return;done=true;es.close();
|
| 579 |
+
const elapsed=(performance.now()-startTime)/1000;
|
| 580 |
+
const tokens=Math.round(text.length/4);
|
| 581 |
+
const speed=tokens/elapsed;
|
| 582 |
+
renderBot(botDiv,text,elapsed,tokens,speed);
|
| 583 |
S.history.push([msg,stripThink(text)]);
|
| 584 |
+
S.msgCount+=2;S.totalTok+=tokens;
|
| 585 |
updateStats();
|
| 586 |
resolve();
|
| 587 |
};
|
|
|
|
| 610 |
function sendEx(t){document.getElementById('chatInput').value=t;sendMsg();}
|
| 611 |
function hideWelcome(){const w=document.getElementById('welcome');if(w){w.style.transition='opacity .25s';w.style.opacity='0';setTimeout(()=>w.remove(),260);}}
|
| 612 |
|
| 613 |
+
function appendUser(text,img,pdfLabel){
|
| 614 |
const t=new Date().toLocaleTimeString('en',{hour:'2-digit',minute:'2-digit'});
|
| 615 |
+
let extra='';
|
| 616 |
+
if(img&&img.type==='image')extra=`<img src="${img.data}" style="max-width:180px;border-radius:9px;margin-bottom:6px;display:block;">`;
|
| 617 |
+
if(pdfLabel)extra=`<span class="pdf-badge">${esc(pdfLabel)}</span><br>`;
|
| 618 |
const el=document.createElement('div');
|
| 619 |
el.className='msg user';
|
| 620 |
+
el.innerHTML=`<div class="avatar">U</div><div class="body">${extra}<div class="bubble">${esc(text)}</div><div class="msg-time">${t}</div></div>`;
|
| 621 |
document.getElementById('msgs').appendChild(el);
|
| 622 |
scrollDown();
|
| 623 |
}
|
| 624 |
function appendBot(){
|
| 625 |
const el=document.createElement('div');
|
| 626 |
el.className='msg bot';
|
| 627 |
+
el.innerHTML='<div class="avatar">π§¬</div><div class="body"><div class="bubble"><div class="typing"><span></span><span></span><span></span></div></div><div class="msg-time">β</div><div class="msg-badges"></div></div>';
|
| 628 |
document.getElementById('msgs').appendChild(el);
|
| 629 |
scrollDown();return el;
|
| 630 |
}
|
|
|
|
| 653 |
return['',raw];
|
| 654 |
}
|
| 655 |
|
| 656 |
+
function renderBot(el,raw,elapsed,tokens,speed){
|
| 657 |
const t=new Date().toLocaleTimeString('en',{hour:'2-digit',minute:'2-digit'});
|
| 658 |
el.querySelector('.msg-time').textContent=t;
|
| 659 |
const b=el.querySelector('.bubble');
|
| 660 |
+
const badges=el.querySelector('.msg-badges');
|
| 661 |
+
let thinkHtml='',ans=raw,thinkChars=0;
|
| 662 |
const tOpen=raw.indexOf('<think>'),tClose=raw.indexOf('</think>');
|
| 663 |
const dOpen=raw.indexOf('<details>'),sClose=raw.indexOf('</summary>'),dClose=raw.indexOf('</details>');
|
| 664 |
|
| 665 |
if(tOpen>=0&&tClose>tOpen){
|
| 666 |
const chain=raw.slice(tOpen+7,tClose).trim();ans=raw.slice(tClose+8).trim();
|
| 667 |
+
thinkHtml=buildThink(chain);thinkChars=chain.length;
|
| 668 |
}else if(tOpen>=0){
|
| 669 |
const thinkLen=raw.length-tOpen-7;ans='';
|
| 670 |
thinkHtml=`<div class="think-blk"><div class="think-hdr" style="cursor:default;">π§ REASONING (${thinkLen} CHARS) <span class="typing" style="display:inline-flex;gap:4px;vertical-align:middle;margin-left:6px;"><span></span><span></span><span></span></span></div></div>`;
|
| 671 |
}else if(dOpen>=0&&sClose>dOpen){
|
| 672 |
const body=dClose>sClose?raw.slice(sClose+10,dClose):raw.slice(sClose+10);
|
| 673 |
const chain=body.replace(/^> ?/gm,'').replace(/<[^>]+>/g,'').trim();
|
| 674 |
+
ans=dClose>0?raw.slice(dClose+10).trim():'';thinkHtml=buildThink(chain);thinkChars=chain.length;
|
| 675 |
}else{
|
|
|
|
| 676 |
const firstLine=raw.trim().split('\n')[0]||'';
|
| 677 |
if(isThinkLine(firstLine)&&raw.length>20){
|
| 678 |
const[think,answer]=splitThinkAnswer(raw);
|
| 679 |
+
if(think&&answer){thinkHtml=buildThink(think);ans=answer;thinkChars=think.length;}
|
| 680 |
+
else if(think&&!answer){
|
|
|
|
| 681 |
ans='';
|
| 682 |
thinkHtml=`<div class="think-blk"><div class="think-hdr" style="cursor:default;">π§ REASONING (${raw.length} CHARS) <span class="typing" style="display:inline-flex;gap:4px;vertical-align:middle;margin-left:6px;"><span></span><span></span><span></span></span></div></div>`;
|
| 683 |
}
|
| 684 |
}
|
| 685 |
}
|
| 686 |
b.innerHTML=thinkHtml+md(ans);
|
| 687 |
+
|
| 688 |
+
// Speed + reasoning badges (only on final render)
|
| 689 |
+
if(elapsed&&badges){
|
| 690 |
+
let bh=`<span class="speed-badge">β‘ ${elapsed.toFixed(1)}s Β· ${tokens} tok Β· ${speed.toFixed(0)} tok/s</span>`;
|
| 691 |
+
if(thinkChars>0)bh+=`<span class="reason-badge">π§ Deep Reasoning Β· ${thinkChars.toLocaleString()} chars analyzed</span>`;
|
| 692 |
+
badges.innerHTML=bh;
|
| 693 |
+
}
|
| 694 |
}
|
| 695 |
function buildThink(chain){
|
| 696 |
if(!chain)return'';
|
|
|
|
| 703 |
return t;
|
| 704 |
}
|
| 705 |
|
| 706 |
+
// Marked.js + code copy
|
| 707 |
(function setupMarked(){
|
| 708 |
if(typeof marked==='undefined')return;
|
| 709 |
const renderer=new marked.Renderer();
|
| 710 |
renderer.code=(code,lang)=>{
|
| 711 |
const language=lang&&hljs.getLanguage(lang)?lang:'plaintext';
|
| 712 |
+
const codeText=typeof code==='object'?code.text:code;
|
| 713 |
+
const highlighted=hljs.highlight(codeText,{language}).value;
|
| 714 |
+
const langLabel=language!=='plaintext'?language:'code';
|
| 715 |
+
const escaped=codeText.replace(/'/g,"\\'").replace(/\n/g,"\\n");
|
| 716 |
+
return`<div class="code-wrap"><div class="code-header"><span class="code-lang-tag">${langLabel}</span><button class="copy-btn" onclick="copyCode(this,'${escaped}')">π Copy</button></div><pre style="border-radius:0 0 8px 8px;margin:0;border-top:none;"><code class="hljs language-${language}">${highlighted}</code></pre></div>`;
|
| 717 |
};
|
| 718 |
renderer.codespan=code=>`<code style="background:var(--fog);padding:1px 5px;border-radius:4px;font-family:var(--fm);font-size:11.5px">${code}</code>`;
|
| 719 |
renderer.link=(href,title,text)=>`<a href="${typeof href==='object'?href.href:href}" target="_blank" rel="noopener">${text}</a>`;
|
| 720 |
marked.setOptions({renderer,breaks:true,gfm:true});
|
| 721 |
})();
|
| 722 |
|
| 723 |
+
function copyCode(btn,code){
|
| 724 |
+
const text=code.replace(/\\n/g,'\n').replace(/\\'/g,"'");
|
| 725 |
+
navigator.clipboard.writeText(text).then(()=>{
|
| 726 |
+
btn.textContent='β
Copied!';btn.classList.add('copied');
|
| 727 |
+
setTimeout(()=>{btn.textContent='π Copy';btn.classList.remove('copied');},2000);
|
| 728 |
+
});
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
function md(t){if(!t)return'';if(typeof marked!=='undefined'){try{return marked.parse(t);}catch(e){}}return t.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/`([^`]+)`/g,'<code>$1</code>').replace(/\*\*(.+?)\*\*/g,'<strong>$1</strong>').replace(/\n/g,'<br>');}
|
| 732 |
function esc(t){return t?t.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'):'';}
|
| 733 |
function scrollDown(){const m=document.getElementById('msgs');m.scrollTop=m.scrollHeight;}
|