spl16 commited on
Commit
b56e43f
·
verified ·
1 Parent(s): ef1b2fd

Upload fork.js with huggingface_hub

Browse files
Files changed (1) hide show
  1. fork.js +19 -11
fork.js CHANGED
@@ -539,18 +539,26 @@ async function search(append) {
539
  search(true);
540
  return;
541
  }
542
- // best-sort promises fitting models first, but the server can no longer
543
- // pre-filter (it only speaks f16): order client-side, full offloads
544
- // first, then partials, each by upstream score. count what is shown —
545
- // the server total is unfiltered while rescaling.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  if (bestSort) {
547
- // whole-resident (gpu/cpu/unified/ram) before experts-in-RAM and
548
- // partials: gpu_moe counts as full in the ranker but is not whole.
549
- const fullFirst = (m) => (m._pick && m._pick.full &&
550
- m._pick.fit && m._pick.fit.tier !== "gpu_moe" ? 0 : 1);
551
- seenModels.filter((m) => m._ui && m._ui.c.isConnected)
552
- .sort((a, b) => fullFirst(a) - fullFirst(b) || b.score - a.score)
553
- .forEach((m) => box.append(m._ui.c));
554
  $("#count").textContent =
555
  `${box.childElementCount.toLocaleString()} models that fit your hardware`;
556
  }
 
539
  search(true);
540
  return;
541
  }
542
+ // the server can no longer pre-filter fits (it only speaks q8_0/f16),
543
+ // so best-sort keeps server score order and the client drops whatever
544
+ // has no pick. count what is shown — the server total is unfiltered.
545
+ // the vram-only and fits-only checkboxes are enforced here too, since
546
+ // their server-side equivalents are forced off while rescaling.
547
+ if (bestSort || $("#fits-only").checked) {
548
+ for (const m of seenModels) {
549
+ if (!m._ui || !m._ui.c.isConnected) continue;
550
+ if (!m._pick) { m._ui.c.remove(); nofitDropped++; }
551
+ }
552
+ }
553
+ if ($("#vram-only").checked && r.kind === "gpu") {
554
+ for (const m of seenModels) {
555
+ if (!m._ui || !m._ui.c.isConnected) continue;
556
+ if (!m._pick || !m._pick.fit || m._pick.fit.tier !== "gpu") {
557
+ m._ui.c.remove(); nofitDropped++;
558
+ }
559
+ }
560
+ }
561
  if (bestSort) {
 
 
 
 
 
 
 
562
  $("#count").textContent =
563
  `${box.childElementCount.toLocaleString()} models that fit your hardware`;
564
  }