Spaces:
Running
Running
Update site
Browse files
assets/{Galaxy-qDqV4piW.js → Galaxy-D9TL5Zw4.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as ee,h as se,g as me,T as re,u as t,s as Ce,f as N,n as oe,a as ie,S as ae,b as de,L as Ae,c as Fe,e as Pe,A as le}from"./index-CvpbkKT6.js";const J=[{label:"Quantized",one:"quantization",color:"#3b6ff5",of:"Quantized from"},{label:"Fine-tuned",one:"fine-tune",color:"#ff8a1f",of:"Fine-tuned from"},{label:"Adapters",one:"adapter",color:"#2f8f5b",of:"Adapter on"},{label:"Merges",one:"merge",color:"#a35bf0",of:"Merge built on"}],be=[1,2,0,3],Q="#1b1b1f",ce="#fbfaf5",fe="#ffd21e",he="#63615b",xe=[0,330,590,800,960],ne=Math.PI*2,ue=["","1st","2nd","3rd","4th+"],ye=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,te=e=>e.split("/").pop()??e,X=(e,a)=>e.nodes.rel[a]>=0?e.nodes.rel[a]:1;function ke(e,a){let h=Math.imul(e^2654435769,2246822507)^Math.imul(a+1,3266489909);return h^=h>>>13,h=Math.imul(h,668265263),h^=h>>>16,(h>>>0)/4294967296}function ve(e){const{parent:a,dl30:h}=e.nodes,d=a.length,C=new Uint8Array(d),T=new Int32Array(d).fill(1),s=new Int32Array(d+1);for(let l=1;l<d;l++)C[l]=Math.min(4,C[a[l]]+1),s[a[l]+1]++;for(let l=0;l<d;l++)s[l+1]+=s[l];const F=s.slice(0,d),z=new Int32Array(Math.max(0,d-1));for(let l=1;l<d;l++)z[F[a[l]]++]=l;for(let l=d-1;l>0;l--)T[a[l]]+=T[l];const x=[0,0,0,0,0];for(let l=1;l<d;l++)x[C[l]]++;const v=l=>1+Math.pow(T[l]-1,.8),y=new Float32Array(d),S=new Float32Array(d),R=new Float32Array(d),B=new Float32Array(d),b=(l,W,M)=>{l.sort((A,P)=>v(P)-v(A)||(h[P]||0)-(h[A]||0));const o=[];l.forEach((A,P)=>P%2?o.unshift(A):o.push(A));const w=o.reduce((A,P)=>A+v(P),0)||1;let k=W;for(const A of o){const P=(M-W)*v(A)/w;y[A]=k+P/2,S[A]=P,k+=P}},U=Array.from(z.subarray(s[0],s[1])),H=[0,1,2,3].map(l=>U.filter(W=>X(e,W)===l)),_=be.filter(l=>H[l].length),K=_.length>1?.05:0,j=_.map(l=>Math.sqrt(H[l].reduce((W,M)=>W+v(M),0))),q=j.reduce((l,W)=>l+W,0)||1,f=_.length>1?.12:1,Z=j.map(l=>Math.max(f,l/q)),Y=Z.reduce((l,W)=>l+W,0),I=ne-K*_.length,V=[];let r=-Math.PI/2-Z[0]/Y*I/2;_.forEach((l,W)=>{const M=Z[W]/Y*I;V.push({rel:l,a0:r,a1:r+M,count:H[l].length}),b(H[l],r,r+M),r+=M+K});for(let l=1;l<d;l++)s[l+1]>s[l]&&b(Array.from(z.subarray(s[l],s[l+1])),y[l]-S[l]/2,y[l]+S[l]/2);let p=1;for(let l=1;l<d;l++)p=Math.max(p,h[l]||0);const $=new Float32Array(d);for(let l=1;l<d;l++)$[l]=(h[l]||0)>0?Math.min(24,1.6+22*Math.sqrt((h[l]||0)/p)):1.2;const n=x.map(l=>Math.max(14,Math.min(120,Math.sqrt(l)*1.3)));for(let l=1;l<d;l++){const W=C[l],M=$[l]>=5,o=xe[W]+(M?0:(ke(l,1)-.5)*n[W]),w=M?y[l]:y[l]+(ke(l,2)-.5)*Math.min(S[l]*.9,.08);R[l]=Math.cos(w)*o,B[l]=Math.sin(w)*o}const i=Int32Array.from({length:d},(l,W)=>W).sort((l,W)=>(h[W]||0)-(h[l]||0)),c=[0,1,2,3].map(l=>Int32Array.from({length:d},(W,M)=>M).filter(W=>W>0&&X(e,W)===l)),u=i.filter(l=>l>0&&(h[l]||0)>0).slice(0,160),m=x.reduce((l,W,M)=>W?M:l,1),g=xe.slice(1,m+1),E=g[g.length-1]+n[m]/2+120,D=24,O=new Map;for(let l=0;l<d;l++){const W=Math.floor(R[l]/D)*100003+Math.floor(B[l]/D),M=O.get(W);M?M.push(l):O.set(W,[l])}return{n:d,x:R,y:B,ang:y,size:$,depth:C,sub:T,start:s,kids:z,byRel:c,order:i,rings:g,sectors:V,gens:x,extent:E,cell:D,grid:O,links:u}}const we=(e,a)=>Math.min(2.6,Math.max(1,Math.sqrt(e/a))),Te=e=>22+6*(e-1);function Se(e,a,h,d,C,T,s){var V;const{x:F,y:z,size:x}=T,v=r=>(r-d.cx)*d.k+a/2,y=r=>(r-d.cy)*d.k+h/2,S=v(0),R=y(0),B=we(d.k,s.kFit),b=s.p>=1?1:1-(1-s.p)**3;e.globalAlpha=1,e.fillStyle=ce,e.fillRect(0,0,a,h);for(const r of T.sectors)s.hidden[r.rel]||(e.beginPath(),e.moveTo(S,R),e.arc(S,R,(T.extent-60)*d.k,r.a0,r.a1),e.closePath(),e.fillStyle=J[r.rel].color,e.globalAlpha=.045,e.fill());e.globalAlpha=1,e.setLineDash([3,5]),e.lineWidth=1,e.strokeStyle="rgba(27,27,31,0.28)";for(const r of T.rings)e.beginPath(),e.arc(S,R,r*d.k*b,0,ne),e.stroke();e.setLineDash([]);const U=(V=s.focus)==null?void 0:V.mark;e.strokeStyle=Q,e.lineWidth=1,e.globalAlpha=(U?.06:.16)*b,e.beginPath();for(const r of T.links){const p=C.nodes.parent[r];s.hidden[X(C,r)]||(U==null?void 0:U[r])===1||(e.moveTo(v(F[p]*b),y(z[p]*b)),e.lineTo(v(F[r]*b),y(z[r]*b)))}if(e.stroke(),e.globalAlpha=1,s.focus){e.strokeStyle=Q,e.lineWidth=1.2,e.globalAlpha=.35*b,e.beginPath();for(const r of s.focus.ids.subarray(1,300)){if(s.hidden[X(C,r)])continue;const p=C.nodes.parent[r];e.moveTo(v(F[p]*b),y(z[p]*b)),e.lineTo(v(F[r]*b),y(z[r]*b))}e.stroke(),e.globalAlpha=1}for(let r=0;r<4;r++){if(s.hidden[r])continue;e.fillStyle=J[r].color,e.globalAlpha=U?.14:.5;const p=new Path2D;for(const $ of T.byRel[r]){if(x[$]>=5||(U==null?void 0:U[$])===1)continue;const n=v(F[$]*b),i=y(z[$]*b),c=x[$]*B;n<-c||i<-c||n>a+c||i>h+c||(c<1.6?p.rect(n-c,i-c,c*2,c*2):(p.moveTo(n+c,i),p.arc(n,i,c,0,ne)))}e.fill(p)}e.globalAlpha=1;for(let r=T.n-1;r>=0;r--){const p=T.order[r];if(p===0||x[p]<5||s.hidden[X(C,p)])continue;const $=v(F[p]*b),n=y(z[p]*b),i=x[p]*B;e.globalAlpha=U&&!U[p]?.25:1,e.beginPath(),e.arc($,n,i,0,ne),e.fillStyle=J[X(C,p)].color,e.fill(),e.lineWidth=2,e.strokeStyle=Q,e.stroke()}if(e.globalAlpha=1,s.focus){const r=s.focus.ids.length<=600;e.lineWidth=1,e.strokeStyle=Q;for(const p of s.focus.ids){if(x[p]>=5||s.hidden[X(C,p)])continue;const $=v(F[p]*b),n=y(z[p]*b),i=Math.max(r?2.6:1.8,x[p]*B);$<-i||n<-i||$>a+i||n>h+i||(e.beginPath(),e.arc($,n,i,0,ne),e.fillStyle=J[X(C,p)].color,e.fill(),r&&e.stroke())}}const H=Te(B);e.beginPath(),e.arc(S+4,R+4,H,0,ne),e.fillStyle=Q,e.fill(),e.beginPath(),e.arc(S,R,H,0,ne),e.fillStyle=fe,e.fill(),e.lineWidth=3,e.strokeStyle=Q,e.stroke();for(const r of[s.sel,s.hover])r>0&&ge(e,a,h,d,C,T,s.kFit,r,r===s.sel);if(s.p<1)return;const _=[[S-H-6,R-H-6,H*2+12,H*2+12],[a-64,0,64,150]];for(const r of T.links){if(s.hidden[X(C,r)]||x[r]<5)continue;const p=x[r]*B;_.push([v(F[r])-p,y(z[r])-p,p*2,p*2])}e.textBaseline="middle",e.lineJoin="round";for(const r of T.sectors){if(s.hidden[r.rel])continue;const p=(r.a0+r.a1)/2,$=(T.extent-70)*d.k,n=S+Math.cos(p)*$,i=R+Math.sin(p)*$,c=J[r.rel].label,u=`${N(r.count)} direct`;e.font="600 13px 'IBM Plex Mono', ui-monospace, monospace";const m=e.measureText(`${c} ${u}`).width,g=Math.max(6,Math.min(a-m-6,n-m/2));i<10||i>h-10||(e.lineWidth=4,e.strokeStyle=ce,e.strokeText(`${c} ${u}`,g,i),e.fillStyle=J[r.rel].color,e.fillText(c,g,i),e.fillStyle=Q,e.fillText(u,g+e.measureText(`${c} `).width,i),_.push([g-2,i-10,m+4,20]))}e.font="500 11.5px 'IBM Plex Mono', ui-monospace, monospace",T.rings.forEach((r,p)=>{const $=`${ue[p+1]} generation`,n=e.measureText($).width,i=S-n/2,c=R+r*d.k+11;c<8||c>h-8||(e.lineWidth=4,e.strokeStyle=ce,e.strokeText($,i,c),e.fillStyle=he,e.fillText($,i,c),_.push([i-2,c-8,n+4,16]))}),e.font="600 15px 'Fredoka', system-ui, sans-serif";const K=te(C.root.id),j=e.measureText(K).width,q=R+H+16;q<h-8&&(e.lineWidth=5,e.strokeStyle=ce,e.strokeText(K,S-j/2,q),e.fillStyle=Q,e.fillText(K,S-j/2,q),_.push([S-j/2-2,q-10,j+4,20]));const f=s.labels??Math.min(40,Math.round(14+10*Math.max(0,Math.log2(d.k/s.kFit)))),Z=new Set;e.font="600 13px 'Source Sans 3', system-ui, sans-serif";let Y=0;const I=(r,p=!1)=>{var D;const $=p&&s.focus?C.nodes.id[r]:te(C.nodes.id[r]);if(!p&&Z.has($))return;const n=v(F[r]),i=y(z[r]),c=x[r]*B,u=Math.cos(T.ang[r])>=-.1,m=e.measureText($).width,g=u?n+c+5:n-c-5-m,E=i-9;g<4||E<4||g+m>a-4||E+18>h-4||!p&&_.some(O=>g<O[0]+O[2]&&g+m>O[0]&&E<O[1]+O[3]&&E+18>O[1])||(_.push([g-2,E,m+4,18]),(D=s.labelHits)==null||D.push([g-2,E,m+4,18,r]),Z.add($),e.lineWidth=4,e.strokeStyle=ce,e.strokeText($,g,i),e.fillStyle=Q,e.fillText($,g,i),Y++)};if(s.sel>0&&I(s.sel,!0),s.focus){for(let r=C.nodes.parent[s.focus.ids[0]];r>0;r=C.nodes.parent[r])I(r);for(const r of s.focus.ids.subarray(0,200))Y<f&&!s.hidden[X(C,r)]&&I(r)}for(let r=0;r<Math.min(T.n,800)&&Y<f;r++){const p=T.order[r];p>0&&(C.nodes.dl30[p]||0)>0&&!s.hidden[X(C,p)]&&I(p)}}function ge(e,a,h,d,C,T,s,F,z){const x=R=>(T.x[R]-d.cx)*d.k+a/2,v=R=>(T.y[R]-d.cy)*d.k+h/2,y=we(d.k,s);e.globalAlpha=.5,e.strokeStyle=J[X(C,F)].color,e.lineWidth=1.2,e.beginPath();for(let R=T.start[F];R<T.start[F+1]&&R<T.start[F]+400;R++){const B=T.kids[R];e.moveTo(x(F),v(F)),e.lineTo(x(B),v(B))}e.stroke(),e.globalAlpha=1,e.strokeStyle=Q,e.lineWidth=2.5,e.beginPath();let S=F;for(e.moveTo(x(S),v(S));S>0;)S=C.nodes.parent[S],e.lineTo(x(S),v(S));e.stroke(),e.beginPath(),e.arc(x(F),v(F),Math.max(5,T.size[F]*y)+5,0,ne),e.lineWidth=3,e.strokeStyle=z?Q:he,e.stroke(),z&&(e.beginPath(),e.arc(x(F),v(F),Math.max(5,T.size[F]*y)+9,0,ne),e.lineWidth=2,e.strokeStyle=fe,e.stroke())}const Me=(e,a,h)=>({k:(Math.min(a,h)/2-8)/e.extent,cx:0,cy:0});function Ie({g:e,L:a,focus:h,hidden:d,sel:C,hoverExt:T,onSel:s,flyTo:F}){const z=le(null),x=le(null),v=le({W:0,H:0,dpr:1,view:{k:1,cx:0,cy:0},kFit:1,p:ye()?1:0,hover:-1,raf:0,labels:[]}),y=le({hidden:d,sel:C,hoverExt:T});y.current={hidden:d,sel:C,hoverExt:T};const S=le(null),R=le(0),B=le(s);B.current=s;const[b,U]=ee(null),H=()=>y.current.hoverExt>0?y.current.hoverExt:v.current.hover,_=()=>{var u,m;const n=v.current,i=(u=x.current)==null?void 0:u.getContext("2d");if(!i||!n.W)return;i.setTransform(n.dpr,0,0,n.dpr,0,0),n.labels=[];const c=performance.now();if(Se(i,n.W,n.H,n.view,e,a,{p:n.p,hidden:y.current.hidden,hover:-1,sel:y.current.sel,kFit:n.kFit,focus:h,labelHits:n.labels}),n.p>=1){const g=((m=S.current)==null?void 0:m.img)??document.createElement("canvas");(g.width!==x.current.width||g.height!==x.current.height)&&(g.width=x.current.width,g.height=x.current.height);const E=g.getContext("2d");E.setTransform(1,0,0,1,0,0),E.drawImage(x.current,0,0),S.current={img:g,view:{...n.view},heavy:performance.now()-c>22}}H()>0&&ge(i,n.W,n.H,n.view,e,a,n.kFit,H(),!1)},K=()=>{var E;const n=v.current,i=(E=x.current)==null?void 0:E.getContext("2d"),c=S.current;if(!i||!c)return _();const u=n.view.k/c.view.k;i.setTransform(1,0,0,1,0,0),i.fillStyle=ce,i.fillRect(0,0,x.current.width,x.current.height);const m=(n.W/2-n.W/2*u+(c.view.cx-n.view.cx)*n.view.k)*n.dpr,g=(n.H/2-n.H/2*u+(c.view.cy-n.view.cy)*n.view.k)*n.dpr;i.drawImage(c.img,m,g,c.img.width*u,c.img.height*u),i.setTransform(n.dpr,0,0,n.dpr,0,0),u===1&&m===0&&g===0&&H()>0&&ge(i,n.W,n.H,n.view,e,a,n.kFit,H(),!1)},j=()=>{const n=v.current;n.raf||(n.raf=requestAnimationFrame(()=>{n.raf=0,_()}))},q=()=>{var i;const n=v.current;if(!((i=S.current)!=null&&i.heavy))return j();n.raf||(n.raf=requestAnimationFrame(()=>{n.raf=0,K()})),clearTimeout(R.current),R.current=window.setTimeout(j,160)},f=()=>{const n=v.current,i=S.current;i&&n.p>=1&&i.view.k===n.view.k&&i.view.cx===n.view.cx&&i.view.cy===n.view.cy?n.raf||(n.raf=requestAnimationFrame(()=>{n.raf=0,K()})):j()},Z=(n,i,c=!1)=>{if(ye()){i(1),j();return}const u=performance.now(),m=g=>{var D;const E=Math.min(1,(g-u)/n);i(E),c&&E<1&&((D=S.current)!=null&&D.heavy)?K():_(),E<1&&requestAnimationFrame(m)};requestAnimationFrame(m)};se(()=>{const n=v.current,i=()=>{const u=z.current.getBoundingClientRect(),m=!n.W;n.W=u.width,n.H=u.height,n.dpr=Math.min(2,devicePixelRatio||1),x.current.width=Math.round(n.W*n.dpr),x.current.height=Math.round(n.H*n.dpr);const g=Me(a,n.W,n.H);if(n.view=m?g:{...n.view,k:n.view.k*(g.k/n.kFit)},n.kFit=g.k,_(),m&&Y.current){const E=Y.current;Y.current=null,I(E)}},c=new ResizeObserver(i);return c.observe(z.current),n.p<1&&Z(1100,u=>{n.p=u}),()=>{c.disconnect(),clearTimeout(R.current)}},[a]),se(j,[d,C]),se(f,[T]);const Y=le(null),I=n=>{const i=v.current;if(!i.W){Y.current=n;return}const c={...i.view},u={k:Math.max(c.k,i.kFit*(n.zoom??3.5)),cx:a.x[n.i],cy:a.y[n.i]};Z(700,m=>{const g=m<.5?4*m**3:1-(-2*m+2)**3/2;i.view={k:c.k*(u.k/c.k)**g,cx:c.cx+(u.cx-c.cx)*g,cy:c.cy+(u.cy-c.cy)*g}},!0)};se(()=>{F&&I(F)},[F]);const V=(n,i,c)=>{const u=v.current,m=u.view,g=(n-u.W/2)/m.k+m.cx,E=(i-u.H/2)/m.k+m.cy,D=Math.min(u.kFit*60,Math.max(u.kFit*.7,m.k*c));u.view={k:D,cx:g-(n-u.W/2)/D,cy:E-(i-u.H/2)/D},q()},r=(n,i)=>{const c=v.current,u=c.view;for(const k of c.labels)if(n>=k[0]&&n<=k[0]+k[2]&&i>=k[1]&&i<=k[1]+k[3])return k[4];const m=(n-c.W/2)/u.k+u.cx,g=(i-c.H/2)/u.k+u.cy,E=we(u.k,c.kFit);if(Math.hypot(m,g)*u.k<=Te(E))return 0;const D=30/u.k,O=Math.floor((m-D)/a.cell),l=Math.floor((m+D)/a.cell),W=Math.floor((g-D)/a.cell),M=Math.floor((g+D)/a.cell);let o=-1,w=1/0;for(let k=O;k<=l;k++)for(let A=W;A<=M;A++)for(const P of a.grid.get(k*100003+A)??[]){if(P===0||y.current.hidden[X(e,P)])continue;const L=a.size[P]*E,G=Math.hypot((a.x[P]-m)*u.k,(a.y[P]-g)*u.k);G<=Math.max(7,L+5)&&G-1.6*L<w&&(o=P,w=G-1.6*L)}return o};se(()=>{const n=x.current,i=v.current,c=new Map;let u=0,m=0;const g=M=>{const o=n.getBoundingClientRect();return{x:M.clientX-o.left,y:M.clientY-o.top}},E=M=>{n.setPointerCapture(M.pointerId),c.set(M.pointerId,g(M)),u=0,m=0},D=M=>{const o=g(M);if(!c.has(M.pointerId)){if(M.pointerType!=="mouse")return;const k=r(o.x,o.y);k!==i.hover&&(i.hover=k,f()),U(k>=0?{i:k,x:o.x,y:o.y}:null),n.style.cursor=k>=0?"pointer":"grab";return}const w=c.get(M.pointerId);if(c.set(M.pointerId,o),c.size===1)u+=Math.abs(o.x-w.x)+Math.abs(o.y-w.y),i.view={...i.view,cx:i.view.cx-(o.x-w.x)/i.view.k,cy:i.view.cy-(o.y-w.y)/i.view.k},i.hover>=0&&(i.hover=-1,U(null)),q();else if(c.size===2){const[k,A]=[...c.values()],P=Math.hypot(k.x-A.x,k.y-A.y);m&&V((k.x+A.x)/2,(k.y+A.y)/2,P/m),m=P,u=99}},O=M=>{const o=c.get(M.pointerId);if(c.delete(M.pointerId),c.size<2&&(m=0),o&&u<6&&c.size===0){const w=r(o.x,o.y);B.current(w>0?w:-1)}},l=M=>{M.preventDefault();const o=g(M);V(o.x,o.y,Math.exp(-M.deltaY*(M.deltaMode?.05:.0018)))},W=()=>{i.hover>=0&&(i.hover=-1,f()),U(null)};return n.addEventListener("pointerdown",E),n.addEventListener("pointermove",D),n.addEventListener("pointerup",O),n.addEventListener("pointercancel",O),n.addEventListener("pointerleave",W),n.addEventListener("wheel",l,{passive:!1}),()=>{n.removeEventListener("pointerdown",E),n.removeEventListener("pointermove",D),n.removeEventListener("pointerup",O),n.removeEventListener("pointercancel",O),n.removeEventListener("pointerleave",W),n.removeEventListener("wheel",l)}},[a]);const p=n=>{const i=v.current;V(i.W/2,i.H/2,n)},$=()=>{const n=v.current,i={...n.view},c=Me(a,n.W,n.H);Z(500,u=>{const m=1-(1-u)**3;n.view={k:i.k+(c.k-i.k)*m,cx:i.cx*(1-m),cy:i.cy*(1-m)}},!0)};return t("div",{class:"o-sky",ref:z,children:[t("canvas",{ref:x,role:"img","aria-label":`${N(a.n-1)} models built on ${e.root.id}, arranged by generation and kind`}),t("div",{class:"g-zoom",children:[t("button",{"aria-label":"Zoom in",onClick:()=>p(1.6),children:"+"}),t("button",{"aria-label":"Zoom out",onClick:()=>p(1/1.6),children:"−"}),t("button",{"aria-label":"Show everything",onClick:$,children:"⤢"})]}),b&&b.i!==C&&t("div",{class:"g-tip",style:{left:Math.min(b.x,(v.current.W||9999)-260),top:b.y},children:[t("b",{children:b.i===0?e.root.id:e.nodes.id[b.i]}),t("span",{children:[b.i===0?"the base model":`${J[X(e,b.i)].one}, ${ue[a.depth[b.i]]} generation`,", ",de(e.nodes.dl30[b.i])," downloads a month",a.sub[b.i]>1?`, ${N(a.sub[b.i]-1)} built on it`:""]})]})]})}async function $e(e,a,h){await Promise.all(["600 60px 'Fredoka'","500 20px 'IBM Plex Mono'","600 14px 'Source Sans 3'"].map(b=>document.fonts.load(b)));const d=1600,C=900,T=document.createElement("canvas");T.width=d,T.height=C;const s=T.getContext("2d"),F=(C/2-20)/a.extent;Se(s,d,C,{k:F,cx:-290/F,cy:0},e,a,{p:1,hidden:[!1,!1,!1,!1],hover:-1,sel:h?h.ids[0]:-1,kFit:F,focus:h,labels:14});const z=s.createLinearGradient(0,0,640,0);z.addColorStop(0,"rgba(251,250,245,1)"),z.addColorStop(.8,"rgba(251,250,245,0.92)"),z.addColorStop(1,"rgba(251,250,245,0)"),s.fillStyle=z,s.fillRect(0,0,640,C);const x=(b,U,H,_,K,j=520)=>{if(s.font=_,s.fillStyle=K,s.textBaseline="alphabetic",s.measureText(b).width>j){for(;b.length>3&&s.measureText(b+"…").width>j;)b=b.slice(0,-1);b+="…"}s.fillText(b,U,H)};s.fillStyle=Q,s.beginPath(),s.roundRect(70,70,56,56,14),s.fill(),s.fillStyle=fe,s.beginPath(),s.roundRect(64,64,56,56,14),s.fill(),s.lineWidth=4,s.strokeStyle=Q,s.stroke(),s.beginPath(),s.lineWidth=5,s.lineJoin="round",s.lineCap="round",s.moveTo(74,94),s.lineTo(84,94),s.lineTo(90,78),s.lineTo(100,108),s.lineTo(106,94),s.lineTo(112,94),s.stroke(),x("Model Pulse Galaxy",138,104,"600 32px 'Fredoka'",Q);const[v,y]=e.root.id.includes("/")?[e.root.id.split("/")[0],te(e.root.id)]:["",e.root.id],S=y.length>18?50:64;x(v?v+"/":"",66,228,"500 24px 'IBM Plex Mono'",he),s.font=`600 ${S}px 'Fredoka'`;const R=Math.min(540,s.measureText(y).width+28);s.fillStyle=fe,s.beginPath(),s.roundRect(58,246,R,S+20,12),s.fill(),x(y,72,246+S+2,`600 ${S}px 'Fredoka'`,Q,510),x(N(e.total),66,432,"600 72px 'Fredoka'",Q),x("models built on it",68,470,"500 24px 'IBM Plex Mono'",he);let B=560;for(const b of a.sectors)s.fillStyle=J[b.rel].color,s.beginPath(),s.arc(76,B-8,9,0,ne),s.fill(),s.lineWidth=2,s.strokeStyle=Q,s.stroke(),x(`${J[b.rel].label} ${N(a.byRel[b.rel].length)}`,98,B,"500 24px 'IBM Plex Mono'",Q),B+=42;return x("modelpulse.ifsp.dev",66,C-50,"500 22px 'IBM Plex Mono'",he),new Promise(b=>T.toBlob(U=>b(U),"image/png"))}function We({counts:e}){const a=e.reduce((h,d)=>h+d,0)||1;return t("span",{class:"o-bar","aria-hidden":"true",children:be.map(h=>e[h]>0&&t("i",{style:{width:`${e[h]/a*100}%`,background:J[h].color}},h))})}function Re(){const[e,a]=ee([]);return se(()=>{document.title="Model galaxies: every model built on Llama, Qwen, FLUX and more · Model Pulse",me("/api/galaxies").then(h=>a(h.slice(0,16))).catch(()=>{})},[]),t(ae,{children:[t("div",{class:"wrap w-entry g-entry",children:[t("h1",{children:[t(Fe,{size:72}),"Model Pulse ",t("span",{class:"hl",children:"Galaxy"})]}),t("p",{class:"lede",children:"Every model built on a base model, laid out like a solar system: one orbit per generation, one sector for each kind of derivative, and the most downloaded as the biggest planets."}),t("div",{class:"g-search",children:t(Pe,{big:!0,placeholder:"A base model, e.g. meta-llama/Llama-3.1-8B",onPick:h=>oe({view:"galaxy",model:h})})})]}),e.length>0&&t("section",{class:"wrap g-fams",children:[t("h2",{children:"The biggest galaxies"}),t("div",{class:"g-grid",children:e.map(h=>t("a",{class:"g-fam",href:ie({view:"galaxy",model:h.id}),onClick:d=>{d.preventDefault(),oe({view:"galaxy",model:h.id})},children:[t("span",{class:"o",children:[h.id.split("/")[0],"/"]}),t("span",{class:"nm",children:te(h.id)}),t(We,{counts:[h.n_quantized,h.n_finetune,h.n_adapter,h.n_merge]}),t("span",{class:"c",children:[t("b",{children:N(h.fam_members)})," models, ",de(h.fam_dl30)," downloads a month"]})]},h.id))})]})]})}function ze({model:e}){const[a,h]=ee(null),[d,C]=ee(null),[T,s]=ee(!0),[F,z]=ee(null),[x,v]=ee([!1,!1,!1,!1]),[y,S]=ee(-1),[R,B]=ee(-1),[b,U]=ee(null),[H,_]=ee(""),[K,j]=ee(!1);se(()=>{if(!e)return;let o=!0;return document.title=`${e} galaxy: every model built on it · Model Pulse`,h(null),C(null),s(!0),z(null),S(-1),_(""),me(`/api/galaxy/${e}`).then(async w=>{const k=w.lineage[w.lineage.length-1];let A=null;if(k){const P=await me(`/api/galaxy/${k}`).catch(()=>null),L=P?P.nodes.id.indexOf(w.root.id):-1;P&&L>0&&(A={g:P,i:L})}o&&(h(w),C(A),A&&S(A.i),document.title=A?`${w.root.id} in the ${A.g.root.id} galaxy · Model Pulse`:`${w.root.id} galaxy: ${w.total.toLocaleString("en")} models built on it · Model Pulse`)}).catch(w=>o&&z(w.message)),()=>{o=!1}},[e]);const q=T&&!!d,f=q?d.g:a,Z=re(()=>a?ve(a):null,[a]),Y=re(()=>d?ve(d.g):null,[d]),I=q?Y:Z,V=re(()=>{if(!d)return null;const{parent:o,dl30:w}=d.g.nodes,k=o.length,A=d.i,P=new Uint8Array(k);P[A]=1;for(let G=A+1;G<k;G++)P[o[G]]===1&&(P[G]=1);for(let G=o[A];G>0;G=o[G])P[G]=2;const L=Int32Array.from({length:k},(G,pe)=>pe).filter(G=>P[G]===1&&G!==A).sort((G,pe)=>(w[pe]||0)-(w[G]||0));return{mark:P,ids:Int32Array.from([A,...L])}},[d]);se(()=>{if(!q)return;const o=setTimeout(()=>U({i:d.i,n:Date.now(),zoom:2.2}),ye()?50:1e3);return()=>clearTimeout(o)},[q,d]);const r=o=>{s(o),S(o&&d?d.i:-1),U(null),v([!1,!1,!1,!1]),_("")},p=re(()=>f?f.nodes.id.map(o=>o.toLowerCase()):[],[f]),$=re(()=>{const o=H.trim().toLowerCase();if(!I||o.length<2)return[];const w=[];for(let k=0;k<I.n&&w.length<8;k++)I.order[k]>0&&p[I.order[k]].includes(o)&&w.push(I.order[k]);return w},[H,I,p]),n=re(()=>{if(!f)return[];const o=f.root.id.split("/")[0],w=new Map;return f.nodes.id.forEach((k,A)=>{if(!A)return;const P=k.split("/")[0];if(P===o)return;const L=w.get(P)??{n:0,dl:0};L.n++,L.dl+=f.nodes.dl30[A]||0,w.set(P,L)}),[...w.entries()].sort((k,A)=>A[1].dl-k[1].dl).slice(0,6)},[f]);if(!e)return t(Re,{});if(F)return t("div",{class:"wrap err",children:[t("h1",{children:"No galaxy to show"}),t("p",{children:F})]});const i=f==null?void 0:f.root,[c,u]=e.includes("/")?[e.split("/")[0],te(e)]:["",e],m=o=>{S(o),_(""),o>0&&U({i:o,n:Date.now()})},g=Ce({view:"galaxy",model:(a==null?void 0:a.root.id)??e}),E=i?q?`${a.root.id} in the ${i.id} galaxy, ${N(f.total)} models built on ${te(i.id)}:`:`${N(f.total)} models are built on ${i.id}. Here is its whole galaxy:`:"",D=!d&&(a!=null&&a.lineage.length)?a.lineage[a.lineage.length-1]:null,O=(d==null?void 0:d.i)??-1,l=I?[0,1,2,3].map(o=>I.byRel[o].length):[0,0,0,0],W=I?Array.from(I.order).filter(o=>o>0).slice(0,12):[],M=o=>J[X(f,o)];return t("div",{class:"galaxy",children:[t("div",{class:"wrap g-head",children:[t("div",{class:"crumbs",children:[t("a",{class:"chip",href:ie({view:"galaxy"}),onClick:o=>{o.preventDefault(),oe({view:"galaxy"})},children:"All galaxies"}),D&&t("a",{class:"chip chip-hot",href:ie({view:"galaxy",model:D}),onClick:o=>{o.preventDefault(),oe({view:"galaxy",model:D})},children:["Part of the ",te(D)," galaxy"]}),t("a",{class:"chip",href:ie({model:e}),onClick:o=>{o.preventDefault(),oe({model:e})},children:"Download history"})]}),t("h1",{class:"model-name",children:[c&&t(ae,{children:[t("span",{class:"org",children:[c,"/"]}),t("wbr",{})]}),t("span",{class:"hl",children:u})]}),t("p",{class:"g-lede",children:f?q?t(ae,{children:["A ",J[X(f,O)].one," of ",te(f.nodes.id[f.nodes.parent[O]]),", ",ue[I.depth[O]]," generation in the galaxy of ",te(i.id),", ",a.total?t(ae,{children:[t("b",{children:N(a.total)})," ",a.total===1?"model is":"models are"," built on it, highlighted below"]}):"with nothing built on it yet","."," ","The whole galaxy has ",t("b",{children:N(f.total)})," models, downloaded ",t("b",{children:de(i.fam_dl30)})," times in the last 30 days."]}):f.total?t(ae,{children:[t("b",{children:N(f.total)})," models are built on ",u,", directly or through other derivatives. Together with the original they were downloaded ",t("b",{children:de(i.fam_dl30)})," times in the last 30 days."]}):t(ae,{children:["No models on the Hub are built on ",u," yet."]}):"Mapping every model built on it…"}),d&&a&&a.total>0&&t("div",{class:"seg g-mode",role:"group","aria-label":"What to show",children:[t("button",{"aria-pressed":T,onClick:()=>r(!0),children:["In the ",te(d.g.root.id)," galaxy"]}),t("button",{"aria-pressed":!T,onClick:()=>r(!1),children:["Only what is built on it (",N(a.total),")"]})]})]}),t("div",{class:"wrap o-layout",children:[t("div",{class:"o-stage",children:[f&&I&&f.total>0?t(Ie,{g:f,L:I,focus:q?V:null,hidden:x,sel:y,hoverExt:R,onSel:S,flyTo:b},q?"ctx":"own"):t("div",{class:"o-sky o-empty",children:f?t("span",{children:"Nothing orbits this model yet."}):t("span",{class:"g-loading",children:"Mapping the galaxy…"})}),t("ul",{class:"o-key",children:[t("li",{children:[t("span",{class:"k-sun","aria-hidden":"true"}),i?te(i.id):u," in the center"]}),q&&t("li",{children:[t("span",{class:"k-focus","aria-hidden":"true"}),u," and what is built on it, highlighted"]}),t("li",{children:[t("span",{class:"k-ring","aria-hidden":"true"}),"one orbit per generation"]}),t("li",{children:[t("span",{class:"k-size","aria-hidden":"true"}),"bigger planet, more downloads"]}),t("li",{children:[t("span",{class:"k-line","aria-hidden":"true"}),"line to the model it was made from"]})]}),f&&I&&f.total>0&&t("div",{class:"g-foot",children:[I.n-1<f.total&&t("p",{class:"muted",children:["Showing the ",N(I.n-1)," most downloaded of ",N(f.total)," models."]}),t("div",{class:"w-actions g-actions",children:[t("button",{class:"btn primary",disabled:K,onClick:async()=>{j(!0);try{const o=await $e(f,I,q?V:null),w=document.createElement("a");w.href=URL.createObjectURL(o),w.download=`${f.root.id.replace("/","_")}-galaxy.png`,w.click(),setTimeout(()=>URL.revokeObjectURL(w.href),2e3)}finally{j(!1)}},children:K?"Drawing…":"Download image"}),t("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(E)}&url=${encodeURIComponent(g)}`,children:"Post on X"}),t("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(g)}`,children:"LinkedIn"}),t("button",{class:"btn",onClick:()=>{var o;return(o=navigator.clipboard)==null?void 0:o.writeText(g)},children:"Copy link"}),t(Ae,{})]})]})]}),f&&I&&f.total>0&&t("aside",{class:"o-panel",children:[t("div",{class:"g-find",children:[t("input",{value:H,onInput:o=>_(o.target.value),placeholder:"Find a model in this galaxy","aria-label":"Find a model in this galaxy",spellcheck:!1,onKeyDown:o=>{o.key==="Enter"&&$.length&&m($[0]),o.key==="Escape"&&_("")}}),$.length>0&&t("ul",{class:"g-found",children:$.map(o=>t("li",{children:t("button",{onClick:()=>m(o),children:[t("span",{children:f.nodes.id[o]}),t("small",{children:[de(f.nodes.dl30[o]),"/mo"]})]})},o))})]}),y>0&&t("div",{class:"o-sel",children:[t("button",{class:"x","aria-label":"Close",onClick:()=>S(-1),children:"×"}),t("a",{class:"id",href:ie({model:f.nodes.id[y]}),onClick:o=>{o.preventDefault(),oe({model:f.nodes.id[y]})},children:f.nodes.id[y]}),t("span",{class:"g-rel",children:[t("i",{style:{background:M(y).color}}),M(y).of," ",te(f.nodes.id[f.nodes.parent[y]]),", ",ue[I.depth[y]]," generation"]}),t("span",{class:"n",children:[t("b",{children:N(f.nodes.dl30[y])})," downloads in the last 30 days"]}),y===O&&q?a.total>0&&t("span",{class:"n",children:[t("b",{children:N(a.total)})," models built on it"]}):I.sub[y]>1&&t("span",{class:"n",children:[t("b",{children:N(I.sub[y]-1)})," models built on it"]}),t("div",{class:"acts",children:[t("a",{class:"btn primary",href:ie({model:f.nodes.id[y]}),onClick:o=>{o.preventDefault(),oe({model:f.nodes.id[y]})},children:"Download history"}),y===O&&q?a.total>0&&t("button",{class:"btn",onClick:()=>r(!1),children:"Only what is built on it"}):(I.sub[y]>1||q)&&t("a",{class:"btn",href:ie({view:"galaxy",model:f.nodes.id[y]}),onClick:o=>{o.preventDefault(),oe({view:"galaxy",model:f.nodes.id[y]})},children:q?"Focus on it":"Its own galaxy"})]})]}),t("section",{children:[t("h2",{children:"By kind"}),t("p",{class:"o-note",children:"All generations. Click to show or hide."}),t("div",{class:"o-kinds",role:"group","aria-label":"Show or hide kinds of derivatives",children:be.filter(o=>l[o]>0).map(o=>t("button",{"aria-pressed":!x[o],onClick:()=>v(x.map((w,k)=>k===o?!w:w)),children:[t("i",{style:{background:J[o].color}}),t("span",{children:J[o].label}),t("b",{children:N(l[o])}),t("span",{class:"share",children:t("span",{style:{width:`${l[o]/(I.n-1)*100}%`,background:J[o].color}})})]},o))}),t("p",{class:"o-gens",children:I.gens.slice(1).map((o,w)=>o?t("span",{children:[t("b",{children:N(o)})," ",ue[w+1]," generation"]},w):null)})]}),t("section",{children:[t("h2",{children:"Most downloaded"}),t("ol",{class:"o-top",children:W.map(o=>t("li",{children:t("button",{class:y===o?"on":"",onClick:()=>m(o),onMouseEnter:()=>B(o),onMouseLeave:()=>B(-1),onFocus:()=>B(o),onBlur:()=>B(-1),children:[t("i",{style:{background:M(o).color}}),t("span",{class:"nm",children:f.nodes.id[o]}),t("span",{class:"v",children:de(f.nodes.dl30[o])})]})},o))})]}),n.length>0&&t("section",{children:[t("h2",{children:"Who builds on it"}),t("ol",{class:"o-top",children:n.map(([o,w])=>t("li",{children:t("a",{href:ie({author:o}),onClick:k=>{k.preventDefault(),oe({author:o})},children:[t("span",{class:"nm",children:o}),t("span",{class:"v",children:[N(w.n)," ",w.n===1?"model":"models"]})]})},o))})]})]})]})]})}export{ze as Galaxy};
|
|
|
|
| 1 |
+
import{d as ee,h as se,g as me,T as re,u as t,s as Ce,f as N,n as oe,a as ie,S as ae,b as de,L as Ae,c as Fe,e as Pe,A as le}from"./index-DkdXqYYM.js";const J=[{label:"Quantized",one:"quantization",color:"#3b6ff5",of:"Quantized from"},{label:"Fine-tuned",one:"fine-tune",color:"#ff8a1f",of:"Fine-tuned from"},{label:"Adapters",one:"adapter",color:"#2f8f5b",of:"Adapter on"},{label:"Merges",one:"merge",color:"#a35bf0",of:"Merge built on"}],be=[1,2,0,3],Q="#1b1b1f",ce="#fbfaf5",fe="#ffd21e",he="#63615b",xe=[0,330,590,800,960],ne=Math.PI*2,ue=["","1st","2nd","3rd","4th+"],ye=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,te=e=>e.split("/").pop()??e,X=(e,a)=>e.nodes.rel[a]>=0?e.nodes.rel[a]:1;function ke(e,a){let h=Math.imul(e^2654435769,2246822507)^Math.imul(a+1,3266489909);return h^=h>>>13,h=Math.imul(h,668265263),h^=h>>>16,(h>>>0)/4294967296}function ve(e){const{parent:a,dl30:h}=e.nodes,d=a.length,C=new Uint8Array(d),T=new Int32Array(d).fill(1),s=new Int32Array(d+1);for(let l=1;l<d;l++)C[l]=Math.min(4,C[a[l]]+1),s[a[l]+1]++;for(let l=0;l<d;l++)s[l+1]+=s[l];const F=s.slice(0,d),z=new Int32Array(Math.max(0,d-1));for(let l=1;l<d;l++)z[F[a[l]]++]=l;for(let l=d-1;l>0;l--)T[a[l]]+=T[l];const x=[0,0,0,0,0];for(let l=1;l<d;l++)x[C[l]]++;const v=l=>1+Math.pow(T[l]-1,.8),y=new Float32Array(d),S=new Float32Array(d),R=new Float32Array(d),B=new Float32Array(d),b=(l,W,M)=>{l.sort((A,P)=>v(P)-v(A)||(h[P]||0)-(h[A]||0));const o=[];l.forEach((A,P)=>P%2?o.unshift(A):o.push(A));const w=o.reduce((A,P)=>A+v(P),0)||1;let k=W;for(const A of o){const P=(M-W)*v(A)/w;y[A]=k+P/2,S[A]=P,k+=P}},U=Array.from(z.subarray(s[0],s[1])),H=[0,1,2,3].map(l=>U.filter(W=>X(e,W)===l)),_=be.filter(l=>H[l].length),K=_.length>1?.05:0,j=_.map(l=>Math.sqrt(H[l].reduce((W,M)=>W+v(M),0))),q=j.reduce((l,W)=>l+W,0)||1,f=_.length>1?.12:1,Z=j.map(l=>Math.max(f,l/q)),Y=Z.reduce((l,W)=>l+W,0),I=ne-K*_.length,V=[];let r=-Math.PI/2-Z[0]/Y*I/2;_.forEach((l,W)=>{const M=Z[W]/Y*I;V.push({rel:l,a0:r,a1:r+M,count:H[l].length}),b(H[l],r,r+M),r+=M+K});for(let l=1;l<d;l++)s[l+1]>s[l]&&b(Array.from(z.subarray(s[l],s[l+1])),y[l]-S[l]/2,y[l]+S[l]/2);let p=1;for(let l=1;l<d;l++)p=Math.max(p,h[l]||0);const $=new Float32Array(d);for(let l=1;l<d;l++)$[l]=(h[l]||0)>0?Math.min(24,1.6+22*Math.sqrt((h[l]||0)/p)):1.2;const n=x.map(l=>Math.max(14,Math.min(120,Math.sqrt(l)*1.3)));for(let l=1;l<d;l++){const W=C[l],M=$[l]>=5,o=xe[W]+(M?0:(ke(l,1)-.5)*n[W]),w=M?y[l]:y[l]+(ke(l,2)-.5)*Math.min(S[l]*.9,.08);R[l]=Math.cos(w)*o,B[l]=Math.sin(w)*o}const i=Int32Array.from({length:d},(l,W)=>W).sort((l,W)=>(h[W]||0)-(h[l]||0)),c=[0,1,2,3].map(l=>Int32Array.from({length:d},(W,M)=>M).filter(W=>W>0&&X(e,W)===l)),u=i.filter(l=>l>0&&(h[l]||0)>0).slice(0,160),m=x.reduce((l,W,M)=>W?M:l,1),g=xe.slice(1,m+1),E=g[g.length-1]+n[m]/2+120,D=24,O=new Map;for(let l=0;l<d;l++){const W=Math.floor(R[l]/D)*100003+Math.floor(B[l]/D),M=O.get(W);M?M.push(l):O.set(W,[l])}return{n:d,x:R,y:B,ang:y,size:$,depth:C,sub:T,start:s,kids:z,byRel:c,order:i,rings:g,sectors:V,gens:x,extent:E,cell:D,grid:O,links:u}}const we=(e,a)=>Math.min(2.6,Math.max(1,Math.sqrt(e/a))),Te=e=>22+6*(e-1);function Se(e,a,h,d,C,T,s){var V;const{x:F,y:z,size:x}=T,v=r=>(r-d.cx)*d.k+a/2,y=r=>(r-d.cy)*d.k+h/2,S=v(0),R=y(0),B=we(d.k,s.kFit),b=s.p>=1?1:1-(1-s.p)**3;e.globalAlpha=1,e.fillStyle=ce,e.fillRect(0,0,a,h);for(const r of T.sectors)s.hidden[r.rel]||(e.beginPath(),e.moveTo(S,R),e.arc(S,R,(T.extent-60)*d.k,r.a0,r.a1),e.closePath(),e.fillStyle=J[r.rel].color,e.globalAlpha=.045,e.fill());e.globalAlpha=1,e.setLineDash([3,5]),e.lineWidth=1,e.strokeStyle="rgba(27,27,31,0.28)";for(const r of T.rings)e.beginPath(),e.arc(S,R,r*d.k*b,0,ne),e.stroke();e.setLineDash([]);const U=(V=s.focus)==null?void 0:V.mark;e.strokeStyle=Q,e.lineWidth=1,e.globalAlpha=(U?.06:.16)*b,e.beginPath();for(const r of T.links){const p=C.nodes.parent[r];s.hidden[X(C,r)]||(U==null?void 0:U[r])===1||(e.moveTo(v(F[p]*b),y(z[p]*b)),e.lineTo(v(F[r]*b),y(z[r]*b)))}if(e.stroke(),e.globalAlpha=1,s.focus){e.strokeStyle=Q,e.lineWidth=1.2,e.globalAlpha=.35*b,e.beginPath();for(const r of s.focus.ids.subarray(1,300)){if(s.hidden[X(C,r)])continue;const p=C.nodes.parent[r];e.moveTo(v(F[p]*b),y(z[p]*b)),e.lineTo(v(F[r]*b),y(z[r]*b))}e.stroke(),e.globalAlpha=1}for(let r=0;r<4;r++){if(s.hidden[r])continue;e.fillStyle=J[r].color,e.globalAlpha=U?.14:.5;const p=new Path2D;for(const $ of T.byRel[r]){if(x[$]>=5||(U==null?void 0:U[$])===1)continue;const n=v(F[$]*b),i=y(z[$]*b),c=x[$]*B;n<-c||i<-c||n>a+c||i>h+c||(c<1.6?p.rect(n-c,i-c,c*2,c*2):(p.moveTo(n+c,i),p.arc(n,i,c,0,ne)))}e.fill(p)}e.globalAlpha=1;for(let r=T.n-1;r>=0;r--){const p=T.order[r];if(p===0||x[p]<5||s.hidden[X(C,p)])continue;const $=v(F[p]*b),n=y(z[p]*b),i=x[p]*B;e.globalAlpha=U&&!U[p]?.25:1,e.beginPath(),e.arc($,n,i,0,ne),e.fillStyle=J[X(C,p)].color,e.fill(),e.lineWidth=2,e.strokeStyle=Q,e.stroke()}if(e.globalAlpha=1,s.focus){const r=s.focus.ids.length<=600;e.lineWidth=1,e.strokeStyle=Q;for(const p of s.focus.ids){if(x[p]>=5||s.hidden[X(C,p)])continue;const $=v(F[p]*b),n=y(z[p]*b),i=Math.max(r?2.6:1.8,x[p]*B);$<-i||n<-i||$>a+i||n>h+i||(e.beginPath(),e.arc($,n,i,0,ne),e.fillStyle=J[X(C,p)].color,e.fill(),r&&e.stroke())}}const H=Te(B);e.beginPath(),e.arc(S+4,R+4,H,0,ne),e.fillStyle=Q,e.fill(),e.beginPath(),e.arc(S,R,H,0,ne),e.fillStyle=fe,e.fill(),e.lineWidth=3,e.strokeStyle=Q,e.stroke();for(const r of[s.sel,s.hover])r>0&&ge(e,a,h,d,C,T,s.kFit,r,r===s.sel);if(s.p<1)return;const _=[[S-H-6,R-H-6,H*2+12,H*2+12],[a-64,0,64,150]];for(const r of T.links){if(s.hidden[X(C,r)]||x[r]<5)continue;const p=x[r]*B;_.push([v(F[r])-p,y(z[r])-p,p*2,p*2])}e.textBaseline="middle",e.lineJoin="round";for(const r of T.sectors){if(s.hidden[r.rel])continue;const p=(r.a0+r.a1)/2,$=(T.extent-70)*d.k,n=S+Math.cos(p)*$,i=R+Math.sin(p)*$,c=J[r.rel].label,u=`${N(r.count)} direct`;e.font="600 13px 'IBM Plex Mono', ui-monospace, monospace";const m=e.measureText(`${c} ${u}`).width,g=Math.max(6,Math.min(a-m-6,n-m/2));i<10||i>h-10||(e.lineWidth=4,e.strokeStyle=ce,e.strokeText(`${c} ${u}`,g,i),e.fillStyle=J[r.rel].color,e.fillText(c,g,i),e.fillStyle=Q,e.fillText(u,g+e.measureText(`${c} `).width,i),_.push([g-2,i-10,m+4,20]))}e.font="500 11.5px 'IBM Plex Mono', ui-monospace, monospace",T.rings.forEach((r,p)=>{const $=`${ue[p+1]} generation`,n=e.measureText($).width,i=S-n/2,c=R+r*d.k+11;c<8||c>h-8||(e.lineWidth=4,e.strokeStyle=ce,e.strokeText($,i,c),e.fillStyle=he,e.fillText($,i,c),_.push([i-2,c-8,n+4,16]))}),e.font="600 15px 'Fredoka', system-ui, sans-serif";const K=te(C.root.id),j=e.measureText(K).width,q=R+H+16;q<h-8&&(e.lineWidth=5,e.strokeStyle=ce,e.strokeText(K,S-j/2,q),e.fillStyle=Q,e.fillText(K,S-j/2,q),_.push([S-j/2-2,q-10,j+4,20]));const f=s.labels??Math.min(40,Math.round(14+10*Math.max(0,Math.log2(d.k/s.kFit)))),Z=new Set;e.font="600 13px 'Source Sans 3', system-ui, sans-serif";let Y=0;const I=(r,p=!1)=>{var D;const $=p&&s.focus?C.nodes.id[r]:te(C.nodes.id[r]);if(!p&&Z.has($))return;const n=v(F[r]),i=y(z[r]),c=x[r]*B,u=Math.cos(T.ang[r])>=-.1,m=e.measureText($).width,g=u?n+c+5:n-c-5-m,E=i-9;g<4||E<4||g+m>a-4||E+18>h-4||!p&&_.some(O=>g<O[0]+O[2]&&g+m>O[0]&&E<O[1]+O[3]&&E+18>O[1])||(_.push([g-2,E,m+4,18]),(D=s.labelHits)==null||D.push([g-2,E,m+4,18,r]),Z.add($),e.lineWidth=4,e.strokeStyle=ce,e.strokeText($,g,i),e.fillStyle=Q,e.fillText($,g,i),Y++)};if(s.sel>0&&I(s.sel,!0),s.focus){for(let r=C.nodes.parent[s.focus.ids[0]];r>0;r=C.nodes.parent[r])I(r);for(const r of s.focus.ids.subarray(0,200))Y<f&&!s.hidden[X(C,r)]&&I(r)}for(let r=0;r<Math.min(T.n,800)&&Y<f;r++){const p=T.order[r];p>0&&(C.nodes.dl30[p]||0)>0&&!s.hidden[X(C,p)]&&I(p)}}function ge(e,a,h,d,C,T,s,F,z){const x=R=>(T.x[R]-d.cx)*d.k+a/2,v=R=>(T.y[R]-d.cy)*d.k+h/2,y=we(d.k,s);e.globalAlpha=.5,e.strokeStyle=J[X(C,F)].color,e.lineWidth=1.2,e.beginPath();for(let R=T.start[F];R<T.start[F+1]&&R<T.start[F]+400;R++){const B=T.kids[R];e.moveTo(x(F),v(F)),e.lineTo(x(B),v(B))}e.stroke(),e.globalAlpha=1,e.strokeStyle=Q,e.lineWidth=2.5,e.beginPath();let S=F;for(e.moveTo(x(S),v(S));S>0;)S=C.nodes.parent[S],e.lineTo(x(S),v(S));e.stroke(),e.beginPath(),e.arc(x(F),v(F),Math.max(5,T.size[F]*y)+5,0,ne),e.lineWidth=3,e.strokeStyle=z?Q:he,e.stroke(),z&&(e.beginPath(),e.arc(x(F),v(F),Math.max(5,T.size[F]*y)+9,0,ne),e.lineWidth=2,e.strokeStyle=fe,e.stroke())}const Me=(e,a,h)=>({k:(Math.min(a,h)/2-8)/e.extent,cx:0,cy:0});function Ie({g:e,L:a,focus:h,hidden:d,sel:C,hoverExt:T,onSel:s,flyTo:F}){const z=le(null),x=le(null),v=le({W:0,H:0,dpr:1,view:{k:1,cx:0,cy:0},kFit:1,p:ye()?1:0,hover:-1,raf:0,labels:[]}),y=le({hidden:d,sel:C,hoverExt:T});y.current={hidden:d,sel:C,hoverExt:T};const S=le(null),R=le(0),B=le(s);B.current=s;const[b,U]=ee(null),H=()=>y.current.hoverExt>0?y.current.hoverExt:v.current.hover,_=()=>{var u,m;const n=v.current,i=(u=x.current)==null?void 0:u.getContext("2d");if(!i||!n.W)return;i.setTransform(n.dpr,0,0,n.dpr,0,0),n.labels=[];const c=performance.now();if(Se(i,n.W,n.H,n.view,e,a,{p:n.p,hidden:y.current.hidden,hover:-1,sel:y.current.sel,kFit:n.kFit,focus:h,labelHits:n.labels}),n.p>=1){const g=((m=S.current)==null?void 0:m.img)??document.createElement("canvas");(g.width!==x.current.width||g.height!==x.current.height)&&(g.width=x.current.width,g.height=x.current.height);const E=g.getContext("2d");E.setTransform(1,0,0,1,0,0),E.drawImage(x.current,0,0),S.current={img:g,view:{...n.view},heavy:performance.now()-c>22}}H()>0&&ge(i,n.W,n.H,n.view,e,a,n.kFit,H(),!1)},K=()=>{var E;const n=v.current,i=(E=x.current)==null?void 0:E.getContext("2d"),c=S.current;if(!i||!c)return _();const u=n.view.k/c.view.k;i.setTransform(1,0,0,1,0,0),i.fillStyle=ce,i.fillRect(0,0,x.current.width,x.current.height);const m=(n.W/2-n.W/2*u+(c.view.cx-n.view.cx)*n.view.k)*n.dpr,g=(n.H/2-n.H/2*u+(c.view.cy-n.view.cy)*n.view.k)*n.dpr;i.drawImage(c.img,m,g,c.img.width*u,c.img.height*u),i.setTransform(n.dpr,0,0,n.dpr,0,0),u===1&&m===0&&g===0&&H()>0&&ge(i,n.W,n.H,n.view,e,a,n.kFit,H(),!1)},j=()=>{const n=v.current;n.raf||(n.raf=requestAnimationFrame(()=>{n.raf=0,_()}))},q=()=>{var i;const n=v.current;if(!((i=S.current)!=null&&i.heavy))return j();n.raf||(n.raf=requestAnimationFrame(()=>{n.raf=0,K()})),clearTimeout(R.current),R.current=window.setTimeout(j,160)},f=()=>{const n=v.current,i=S.current;i&&n.p>=1&&i.view.k===n.view.k&&i.view.cx===n.view.cx&&i.view.cy===n.view.cy?n.raf||(n.raf=requestAnimationFrame(()=>{n.raf=0,K()})):j()},Z=(n,i,c=!1)=>{if(ye()){i(1),j();return}const u=performance.now(),m=g=>{var D;const E=Math.min(1,(g-u)/n);i(E),c&&E<1&&((D=S.current)!=null&&D.heavy)?K():_(),E<1&&requestAnimationFrame(m)};requestAnimationFrame(m)};se(()=>{const n=v.current,i=()=>{const u=z.current.getBoundingClientRect(),m=!n.W;n.W=u.width,n.H=u.height,n.dpr=Math.min(2,devicePixelRatio||1),x.current.width=Math.round(n.W*n.dpr),x.current.height=Math.round(n.H*n.dpr);const g=Me(a,n.W,n.H);if(n.view=m?g:{...n.view,k:n.view.k*(g.k/n.kFit)},n.kFit=g.k,_(),m&&Y.current){const E=Y.current;Y.current=null,I(E)}},c=new ResizeObserver(i);return c.observe(z.current),n.p<1&&Z(1100,u=>{n.p=u}),()=>{c.disconnect(),clearTimeout(R.current)}},[a]),se(j,[d,C]),se(f,[T]);const Y=le(null),I=n=>{const i=v.current;if(!i.W){Y.current=n;return}const c={...i.view},u={k:Math.max(c.k,i.kFit*(n.zoom??3.5)),cx:a.x[n.i],cy:a.y[n.i]};Z(700,m=>{const g=m<.5?4*m**3:1-(-2*m+2)**3/2;i.view={k:c.k*(u.k/c.k)**g,cx:c.cx+(u.cx-c.cx)*g,cy:c.cy+(u.cy-c.cy)*g}},!0)};se(()=>{F&&I(F)},[F]);const V=(n,i,c)=>{const u=v.current,m=u.view,g=(n-u.W/2)/m.k+m.cx,E=(i-u.H/2)/m.k+m.cy,D=Math.min(u.kFit*60,Math.max(u.kFit*.7,m.k*c));u.view={k:D,cx:g-(n-u.W/2)/D,cy:E-(i-u.H/2)/D},q()},r=(n,i)=>{const c=v.current,u=c.view;for(const k of c.labels)if(n>=k[0]&&n<=k[0]+k[2]&&i>=k[1]&&i<=k[1]+k[3])return k[4];const m=(n-c.W/2)/u.k+u.cx,g=(i-c.H/2)/u.k+u.cy,E=we(u.k,c.kFit);if(Math.hypot(m,g)*u.k<=Te(E))return 0;const D=30/u.k,O=Math.floor((m-D)/a.cell),l=Math.floor((m+D)/a.cell),W=Math.floor((g-D)/a.cell),M=Math.floor((g+D)/a.cell);let o=-1,w=1/0;for(let k=O;k<=l;k++)for(let A=W;A<=M;A++)for(const P of a.grid.get(k*100003+A)??[]){if(P===0||y.current.hidden[X(e,P)])continue;const L=a.size[P]*E,G=Math.hypot((a.x[P]-m)*u.k,(a.y[P]-g)*u.k);G<=Math.max(7,L+5)&&G-1.6*L<w&&(o=P,w=G-1.6*L)}return o};se(()=>{const n=x.current,i=v.current,c=new Map;let u=0,m=0;const g=M=>{const o=n.getBoundingClientRect();return{x:M.clientX-o.left,y:M.clientY-o.top}},E=M=>{n.setPointerCapture(M.pointerId),c.set(M.pointerId,g(M)),u=0,m=0},D=M=>{const o=g(M);if(!c.has(M.pointerId)){if(M.pointerType!=="mouse")return;const k=r(o.x,o.y);k!==i.hover&&(i.hover=k,f()),U(k>=0?{i:k,x:o.x,y:o.y}:null),n.style.cursor=k>=0?"pointer":"grab";return}const w=c.get(M.pointerId);if(c.set(M.pointerId,o),c.size===1)u+=Math.abs(o.x-w.x)+Math.abs(o.y-w.y),i.view={...i.view,cx:i.view.cx-(o.x-w.x)/i.view.k,cy:i.view.cy-(o.y-w.y)/i.view.k},i.hover>=0&&(i.hover=-1,U(null)),q();else if(c.size===2){const[k,A]=[...c.values()],P=Math.hypot(k.x-A.x,k.y-A.y);m&&V((k.x+A.x)/2,(k.y+A.y)/2,P/m),m=P,u=99}},O=M=>{const o=c.get(M.pointerId);if(c.delete(M.pointerId),c.size<2&&(m=0),o&&u<6&&c.size===0){const w=r(o.x,o.y);B.current(w>0?w:-1)}},l=M=>{M.preventDefault();const o=g(M);V(o.x,o.y,Math.exp(-M.deltaY*(M.deltaMode?.05:.0018)))},W=()=>{i.hover>=0&&(i.hover=-1,f()),U(null)};return n.addEventListener("pointerdown",E),n.addEventListener("pointermove",D),n.addEventListener("pointerup",O),n.addEventListener("pointercancel",O),n.addEventListener("pointerleave",W),n.addEventListener("wheel",l,{passive:!1}),()=>{n.removeEventListener("pointerdown",E),n.removeEventListener("pointermove",D),n.removeEventListener("pointerup",O),n.removeEventListener("pointercancel",O),n.removeEventListener("pointerleave",W),n.removeEventListener("wheel",l)}},[a]);const p=n=>{const i=v.current;V(i.W/2,i.H/2,n)},$=()=>{const n=v.current,i={...n.view},c=Me(a,n.W,n.H);Z(500,u=>{const m=1-(1-u)**3;n.view={k:i.k+(c.k-i.k)*m,cx:i.cx*(1-m),cy:i.cy*(1-m)}},!0)};return t("div",{class:"o-sky",ref:z,children:[t("canvas",{ref:x,role:"img","aria-label":`${N(a.n-1)} models built on ${e.root.id}, arranged by generation and kind`}),t("div",{class:"g-zoom",children:[t("button",{"aria-label":"Zoom in",onClick:()=>p(1.6),children:"+"}),t("button",{"aria-label":"Zoom out",onClick:()=>p(1/1.6),children:"−"}),t("button",{"aria-label":"Show everything",onClick:$,children:"⤢"})]}),b&&b.i!==C&&t("div",{class:"g-tip",style:{left:Math.min(b.x,(v.current.W||9999)-260),top:b.y},children:[t("b",{children:b.i===0?e.root.id:e.nodes.id[b.i]}),t("span",{children:[b.i===0?"the base model":`${J[X(e,b.i)].one}, ${ue[a.depth[b.i]]} generation`,", ",de(e.nodes.dl30[b.i])," downloads a month",a.sub[b.i]>1?`, ${N(a.sub[b.i]-1)} built on it`:""]})]})]})}async function $e(e,a,h){await Promise.all(["600 60px 'Fredoka'","500 20px 'IBM Plex Mono'","600 14px 'Source Sans 3'"].map(b=>document.fonts.load(b)));const d=1600,C=900,T=document.createElement("canvas");T.width=d,T.height=C;const s=T.getContext("2d"),F=(C/2-20)/a.extent;Se(s,d,C,{k:F,cx:-290/F,cy:0},e,a,{p:1,hidden:[!1,!1,!1,!1],hover:-1,sel:h?h.ids[0]:-1,kFit:F,focus:h,labels:14});const z=s.createLinearGradient(0,0,640,0);z.addColorStop(0,"rgba(251,250,245,1)"),z.addColorStop(.8,"rgba(251,250,245,0.92)"),z.addColorStop(1,"rgba(251,250,245,0)"),s.fillStyle=z,s.fillRect(0,0,640,C);const x=(b,U,H,_,K,j=520)=>{if(s.font=_,s.fillStyle=K,s.textBaseline="alphabetic",s.measureText(b).width>j){for(;b.length>3&&s.measureText(b+"…").width>j;)b=b.slice(0,-1);b+="…"}s.fillText(b,U,H)};s.fillStyle=Q,s.beginPath(),s.roundRect(70,70,56,56,14),s.fill(),s.fillStyle=fe,s.beginPath(),s.roundRect(64,64,56,56,14),s.fill(),s.lineWidth=4,s.strokeStyle=Q,s.stroke(),s.beginPath(),s.lineWidth=5,s.lineJoin="round",s.lineCap="round",s.moveTo(74,94),s.lineTo(84,94),s.lineTo(90,78),s.lineTo(100,108),s.lineTo(106,94),s.lineTo(112,94),s.stroke(),x("Model Pulse Galaxy",138,104,"600 32px 'Fredoka'",Q);const[v,y]=e.root.id.includes("/")?[e.root.id.split("/")[0],te(e.root.id)]:["",e.root.id],S=y.length>18?50:64;x(v?v+"/":"",66,228,"500 24px 'IBM Plex Mono'",he),s.font=`600 ${S}px 'Fredoka'`;const R=Math.min(540,s.measureText(y).width+28);s.fillStyle=fe,s.beginPath(),s.roundRect(58,246,R,S+20,12),s.fill(),x(y,72,246+S+2,`600 ${S}px 'Fredoka'`,Q,510),x(N(e.total),66,432,"600 72px 'Fredoka'",Q),x("models built on it",68,470,"500 24px 'IBM Plex Mono'",he);let B=560;for(const b of a.sectors)s.fillStyle=J[b.rel].color,s.beginPath(),s.arc(76,B-8,9,0,ne),s.fill(),s.lineWidth=2,s.strokeStyle=Q,s.stroke(),x(`${J[b.rel].label} ${N(a.byRel[b.rel].length)}`,98,B,"500 24px 'IBM Plex Mono'",Q),B+=42;return x("modelpulse.ifsp.dev",66,C-50,"500 22px 'IBM Plex Mono'",he),new Promise(b=>T.toBlob(U=>b(U),"image/png"))}function We({counts:e}){const a=e.reduce((h,d)=>h+d,0)||1;return t("span",{class:"o-bar","aria-hidden":"true",children:be.map(h=>e[h]>0&&t("i",{style:{width:`${e[h]/a*100}%`,background:J[h].color}},h))})}function Re(){const[e,a]=ee([]);return se(()=>{document.title="Model galaxies: every model built on Llama, Qwen, FLUX and more · Model Pulse",me("/api/galaxies").then(h=>a(h.slice(0,16))).catch(()=>{})},[]),t(ae,{children:[t("div",{class:"wrap w-entry g-entry",children:[t("h1",{children:[t(Fe,{size:72}),"Model Pulse ",t("span",{class:"hl",children:"Galaxy"})]}),t("p",{class:"lede",children:"Every model built on a base model, laid out like a solar system: one orbit per generation, one sector for each kind of derivative, and the most downloaded as the biggest planets."}),t("div",{class:"g-search",children:t(Pe,{big:!0,placeholder:"A base model, e.g. meta-llama/Llama-3.1-8B",onPick:h=>oe({view:"galaxy",model:h})})})]}),e.length>0&&t("section",{class:"wrap g-fams",children:[t("h2",{children:"The biggest galaxies"}),t("div",{class:"g-grid",children:e.map(h=>t("a",{class:"g-fam",href:ie({view:"galaxy",model:h.id}),onClick:d=>{d.preventDefault(),oe({view:"galaxy",model:h.id})},children:[t("span",{class:"o",children:[h.id.split("/")[0],"/"]}),t("span",{class:"nm",children:te(h.id)}),t(We,{counts:[h.n_quantized,h.n_finetune,h.n_adapter,h.n_merge]}),t("span",{class:"c",children:[t("b",{children:N(h.fam_members)})," models, ",de(h.fam_dl30)," downloads a month"]})]},h.id))})]})]})}function ze({model:e}){const[a,h]=ee(null),[d,C]=ee(null),[T,s]=ee(!0),[F,z]=ee(null),[x,v]=ee([!1,!1,!1,!1]),[y,S]=ee(-1),[R,B]=ee(-1),[b,U]=ee(null),[H,_]=ee(""),[K,j]=ee(!1);se(()=>{if(!e)return;let o=!0;return document.title=`${e} galaxy: every model built on it · Model Pulse`,h(null),C(null),s(!0),z(null),S(-1),_(""),me(`/api/galaxy/${e}`).then(async w=>{const k=w.lineage[w.lineage.length-1];let A=null;if(k){const P=await me(`/api/galaxy/${k}`).catch(()=>null),L=P?P.nodes.id.indexOf(w.root.id):-1;P&&L>0&&(A={g:P,i:L})}o&&(h(w),C(A),A&&S(A.i),document.title=A?`${w.root.id} in the ${A.g.root.id} galaxy · Model Pulse`:`${w.root.id} galaxy: ${w.total.toLocaleString("en")} models built on it · Model Pulse`)}).catch(w=>o&&z(w.message)),()=>{o=!1}},[e]);const q=T&&!!d,f=q?d.g:a,Z=re(()=>a?ve(a):null,[a]),Y=re(()=>d?ve(d.g):null,[d]),I=q?Y:Z,V=re(()=>{if(!d)return null;const{parent:o,dl30:w}=d.g.nodes,k=o.length,A=d.i,P=new Uint8Array(k);P[A]=1;for(let G=A+1;G<k;G++)P[o[G]]===1&&(P[G]=1);for(let G=o[A];G>0;G=o[G])P[G]=2;const L=Int32Array.from({length:k},(G,pe)=>pe).filter(G=>P[G]===1&&G!==A).sort((G,pe)=>(w[pe]||0)-(w[G]||0));return{mark:P,ids:Int32Array.from([A,...L])}},[d]);se(()=>{if(!q)return;const o=setTimeout(()=>U({i:d.i,n:Date.now(),zoom:2.2}),ye()?50:1e3);return()=>clearTimeout(o)},[q,d]);const r=o=>{s(o),S(o&&d?d.i:-1),U(null),v([!1,!1,!1,!1]),_("")},p=re(()=>f?f.nodes.id.map(o=>o.toLowerCase()):[],[f]),$=re(()=>{const o=H.trim().toLowerCase();if(!I||o.length<2)return[];const w=[];for(let k=0;k<I.n&&w.length<8;k++)I.order[k]>0&&p[I.order[k]].includes(o)&&w.push(I.order[k]);return w},[H,I,p]),n=re(()=>{if(!f)return[];const o=f.root.id.split("/")[0],w=new Map;return f.nodes.id.forEach((k,A)=>{if(!A)return;const P=k.split("/")[0];if(P===o)return;const L=w.get(P)??{n:0,dl:0};L.n++,L.dl+=f.nodes.dl30[A]||0,w.set(P,L)}),[...w.entries()].sort((k,A)=>A[1].dl-k[1].dl).slice(0,6)},[f]);if(!e)return t(Re,{});if(F)return t("div",{class:"wrap err",children:[t("h1",{children:"No galaxy to show"}),t("p",{children:F})]});const i=f==null?void 0:f.root,[c,u]=e.includes("/")?[e.split("/")[0],te(e)]:["",e],m=o=>{S(o),_(""),o>0&&U({i:o,n:Date.now()})},g=Ce({view:"galaxy",model:(a==null?void 0:a.root.id)??e}),E=i?q?`${a.root.id} in the ${i.id} galaxy, ${N(f.total)} models built on ${te(i.id)}:`:`${N(f.total)} models are built on ${i.id}. Here is its whole galaxy:`:"",D=!d&&(a!=null&&a.lineage.length)?a.lineage[a.lineage.length-1]:null,O=(d==null?void 0:d.i)??-1,l=I?[0,1,2,3].map(o=>I.byRel[o].length):[0,0,0,0],W=I?Array.from(I.order).filter(o=>o>0).slice(0,12):[],M=o=>J[X(f,o)];return t("div",{class:"galaxy",children:[t("div",{class:"wrap g-head",children:[t("div",{class:"crumbs",children:[t("a",{class:"chip",href:ie({view:"galaxy"}),onClick:o=>{o.preventDefault(),oe({view:"galaxy"})},children:"All galaxies"}),D&&t("a",{class:"chip chip-hot",href:ie({view:"galaxy",model:D}),onClick:o=>{o.preventDefault(),oe({view:"galaxy",model:D})},children:["Part of the ",te(D)," galaxy"]}),t("a",{class:"chip",href:ie({model:e}),onClick:o=>{o.preventDefault(),oe({model:e})},children:"Download history"})]}),t("h1",{class:"model-name",children:[c&&t(ae,{children:[t("span",{class:"org",children:[c,"/"]}),t("wbr",{})]}),t("span",{class:"hl",children:u})]}),t("p",{class:"g-lede",children:f?q?t(ae,{children:["A ",J[X(f,O)].one," of ",te(f.nodes.id[f.nodes.parent[O]]),", ",ue[I.depth[O]]," generation in the galaxy of ",te(i.id),", ",a.total?t(ae,{children:[t("b",{children:N(a.total)})," ",a.total===1?"model is":"models are"," built on it, highlighted below"]}):"with nothing built on it yet","."," ","The whole galaxy has ",t("b",{children:N(f.total)})," models, downloaded ",t("b",{children:de(i.fam_dl30)})," times in the last 30 days."]}):f.total?t(ae,{children:[t("b",{children:N(f.total)})," models are built on ",u,", directly or through other derivatives. Together with the original they were downloaded ",t("b",{children:de(i.fam_dl30)})," times in the last 30 days."]}):t(ae,{children:["No models on the Hub are built on ",u," yet."]}):"Mapping every model built on it…"}),d&&a&&a.total>0&&t("div",{class:"seg g-mode",role:"group","aria-label":"What to show",children:[t("button",{"aria-pressed":T,onClick:()=>r(!0),children:["In the ",te(d.g.root.id)," galaxy"]}),t("button",{"aria-pressed":!T,onClick:()=>r(!1),children:["Only what is built on it (",N(a.total),")"]})]})]}),t("div",{class:"wrap o-layout",children:[t("div",{class:"o-stage",children:[f&&I&&f.total>0?t(Ie,{g:f,L:I,focus:q?V:null,hidden:x,sel:y,hoverExt:R,onSel:S,flyTo:b},q?"ctx":"own"):t("div",{class:"o-sky o-empty",children:f?t("span",{children:"Nothing orbits this model yet."}):t("span",{class:"g-loading",children:"Mapping the galaxy…"})}),t("ul",{class:"o-key",children:[t("li",{children:[t("span",{class:"k-sun","aria-hidden":"true"}),i?te(i.id):u," in the center"]}),q&&t("li",{children:[t("span",{class:"k-focus","aria-hidden":"true"}),u," and what is built on it, highlighted"]}),t("li",{children:[t("span",{class:"k-ring","aria-hidden":"true"}),"one orbit per generation"]}),t("li",{children:[t("span",{class:"k-size","aria-hidden":"true"}),"bigger planet, more downloads"]}),t("li",{children:[t("span",{class:"k-line","aria-hidden":"true"}),"line to the model it was made from"]})]}),f&&I&&f.total>0&&t("div",{class:"g-foot",children:[I.n-1<f.total&&t("p",{class:"muted",children:["Showing the ",N(I.n-1)," most downloaded of ",N(f.total)," models."]}),t("div",{class:"w-actions g-actions",children:[t("button",{class:"btn primary",disabled:K,onClick:async()=>{j(!0);try{const o=await $e(f,I,q?V:null),w=document.createElement("a");w.href=URL.createObjectURL(o),w.download=`${f.root.id.replace("/","_")}-galaxy.png`,w.click(),setTimeout(()=>URL.revokeObjectURL(w.href),2e3)}finally{j(!1)}},children:K?"Drawing…":"Download image"}),t("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(E)}&url=${encodeURIComponent(g)}`,children:"Post on X"}),t("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(g)}`,children:"LinkedIn"}),t("button",{class:"btn",onClick:()=>{var o;return(o=navigator.clipboard)==null?void 0:o.writeText(g)},children:"Copy link"}),t(Ae,{})]})]})]}),f&&I&&f.total>0&&t("aside",{class:"o-panel",children:[t("div",{class:"g-find",children:[t("input",{value:H,onInput:o=>_(o.target.value),placeholder:"Find a model in this galaxy","aria-label":"Find a model in this galaxy",spellcheck:!1,onKeyDown:o=>{o.key==="Enter"&&$.length&&m($[0]),o.key==="Escape"&&_("")}}),$.length>0&&t("ul",{class:"g-found",children:$.map(o=>t("li",{children:t("button",{onClick:()=>m(o),children:[t("span",{children:f.nodes.id[o]}),t("small",{children:[de(f.nodes.dl30[o]),"/mo"]})]})},o))})]}),y>0&&t("div",{class:"o-sel",children:[t("button",{class:"x","aria-label":"Close",onClick:()=>S(-1),children:"×"}),t("a",{class:"id",href:ie({model:f.nodes.id[y]}),onClick:o=>{o.preventDefault(),oe({model:f.nodes.id[y]})},children:f.nodes.id[y]}),t("span",{class:"g-rel",children:[t("i",{style:{background:M(y).color}}),M(y).of," ",te(f.nodes.id[f.nodes.parent[y]]),", ",ue[I.depth[y]]," generation"]}),t("span",{class:"n",children:[t("b",{children:N(f.nodes.dl30[y])})," downloads in the last 30 days"]}),y===O&&q?a.total>0&&t("span",{class:"n",children:[t("b",{children:N(a.total)})," models built on it"]}):I.sub[y]>1&&t("span",{class:"n",children:[t("b",{children:N(I.sub[y]-1)})," models built on it"]}),t("div",{class:"acts",children:[t("a",{class:"btn primary",href:ie({model:f.nodes.id[y]}),onClick:o=>{o.preventDefault(),oe({model:f.nodes.id[y]})},children:"Download history"}),y===O&&q?a.total>0&&t("button",{class:"btn",onClick:()=>r(!1),children:"Only what is built on it"}):(I.sub[y]>1||q)&&t("a",{class:"btn",href:ie({view:"galaxy",model:f.nodes.id[y]}),onClick:o=>{o.preventDefault(),oe({view:"galaxy",model:f.nodes.id[y]})},children:q?"Focus on it":"Its own galaxy"})]})]}),t("section",{children:[t("h2",{children:"By kind"}),t("p",{class:"o-note",children:"All generations. Click to show or hide."}),t("div",{class:"o-kinds",role:"group","aria-label":"Show or hide kinds of derivatives",children:be.filter(o=>l[o]>0).map(o=>t("button",{"aria-pressed":!x[o],onClick:()=>v(x.map((w,k)=>k===o?!w:w)),children:[t("i",{style:{background:J[o].color}}),t("span",{children:J[o].label}),t("b",{children:N(l[o])}),t("span",{class:"share",children:t("span",{style:{width:`${l[o]/(I.n-1)*100}%`,background:J[o].color}})})]},o))}),t("p",{class:"o-gens",children:I.gens.slice(1).map((o,w)=>o?t("span",{children:[t("b",{children:N(o)})," ",ue[w+1]," generation"]},w):null)})]}),t("section",{children:[t("h2",{children:"Most downloaded"}),t("ol",{class:"o-top",children:W.map(o=>t("li",{children:t("button",{class:y===o?"on":"",onClick:()=>m(o),onMouseEnter:()=>B(o),onMouseLeave:()=>B(-1),onFocus:()=>B(o),onBlur:()=>B(-1),children:[t("i",{style:{background:M(o).color}}),t("span",{class:"nm",children:f.nodes.id[o]}),t("span",{class:"v",children:de(f.nodes.dl30[o])})]})},o))})]}),n.length>0&&t("section",{children:[t("h2",{children:"Who builds on it"}),t("ol",{class:"o-top",children:n.map(([o,w])=>t("li",{children:t("a",{href:ie({author:o}),onClick:k=>{k.preventDefault(),oe({author:o})},children:[t("span",{class:"nm",children:o}),t("span",{class:"v",children:[N(w.n)," ",w.n===1?"model":"models"]})]})},o))})]})]})]})]})}export{ze as Galaxy};
|
assets/{Report-hwBKraUD.js → Report-DEooC0v-.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
var Ae=Object.defineProperty;var ze=(n,e,t)=>e in n?Ae(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var k=(n,e,t)=>ze(n,typeof e!="symbol"?e+"":e,t);import{T as Be,h as _e,u as Ie,n as Le}from"./index-
|
| 2 |
]`).replace("lheading",we).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Je=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ke=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xe=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Xe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,_=/[\s\p{P}\p{S}]/u,q=/[^\s\p{P}\p{S}]/u,Ve=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_).getRegex(),Ye=/[\p{Pi}\p{Ps}"']/u,ye=/(?!~)[\p{P}\p{S}]/u,et=/(?!~)[\s\p{P}\p{S}]/u,tt=/(?:[^\s\p{P}\p{S}]|~)/u,nt=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Se=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,st=g(Se,"u").replace(/punct/g,T).getRegex(),at=g(Se,"u").replace(/punct/g,ye).getRegex(),rt=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,ot=g(rt,"u").replace(/openQuote/g,Ye).replace(/punct/g,T).getRegex(),Me="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lt=g(Me,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),it=g(Me,"gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,et).replace(/punct/g,ye).getRegex(),ht="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",ct=g(ht,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),dt=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),pt="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",ut=g(pt,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),gt=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),mt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ft=g(mt,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),kt=g(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),wt=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bt=g(ee).replace("(?:-->|$)","-->").getRegex(),xt=g("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Te=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Z=g(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Te).getRegex(),yt=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Z).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),St=g(/^!?\[(label)\]\[(ref)\]/).replace("label",Z).replace("ref",Y).getRegex(),Mt=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),oe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Tt=g(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Te).getRegex(),vt=g("reflink|nolink(?!\\()","g").replace("reflink",g(/^!?\[(label)\]\[(ref)\]/).replace("label",Tt).replace("ref",oe).getRegex()).replace("nolink",g(/^!?\[(ref)\](?:\[\])?/).replace("ref",oe).getRegex()).getRegex(),le=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Rt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,$t=g(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Rt).getRegex(),ne={_backpedal:$,anyPunctuation:kt,autolink:wt,blockSkip:nt,br:xe,code:Ke,del:$,delLDelim:$,delRDelim:$,emStrongLDelim:st,emStrongRDelimAst:lt,emStrongRDelimUnd:dt,escape:Je,link:yt,nolink:Mt,punctuation:Ve,reflink:St,reflinkSearch:vt,tag:xt,text:Xe,url:$},At={...ne,emStrongLDelim:ot,emStrongRDelimAst:ct,emStrongRDelimUnd:ut,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",Z).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z).getRegex()},j={...ne,emStrongRDelimAst:it,emStrongLDelim:at,delLDelim:gt,delRDelim:ft,url:g(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",$t).replace("protocol",le).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",le).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},zt={...j,br:g(xe).replace("{2,}","*").getRegex(),text:g(j.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},H={normal:te,gfm:je,pedantic:We},C={normal:ne,gfm:j,breaks:zt,pedantic:At},Bt={"&":"&","<":"<",">":">",'"':""","'":"'"},ie=n=>Bt[n];function y(n,e){if(e){if(x.escapeTest.test(n))return n.replace(x.escapeReplace,ie)}else if(x.escapeTestNoEncode.test(n))return n.replace(x.escapeReplaceNoEncode,ie);return n}function _t(n){return n.replace(x.numericCharacterReference,(e,t,a)=>{let s=t===void 0?Number.parseInt(a,16):Number.parseInt(t,10);return s===0||s>1114111||s>=55296&&s<=57343?"�":String.fromCodePoint(s)})}function he(n){try{n=encodeURI(n).replace(x.percentDecode,"%")}catch{return null}return n}function ce(n,e){var o;let t=n.replace(x.findPipe,(l,i,r)=>{let d=!1,h=i;for(;--h>=0&&r[h]==="\\";)d=!d;return d?"|":" |"}),a=t.split(x.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!((o=a.at(-1))!=null&&o.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(x.slashPipe,"|");return a}function R(n,e,t){let a=n.length;if(a===0)return"";let s=0;for(;s<a&&n.charAt(a-s-1)===e;)s++;return n.slice(0,a-s)}function de(n){let e=n.split(`
|
| 3 |
`),t=e.length-1;for(;t>=0&&x.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
|
| 4 |
`)}function G(n){return n.trim().toLowerCase().toUpperCase().toLowerCase()}function It(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let a=0;a<n.length;a++)if(n[a]==="\\")a++;else if(n[a]===e[0])t++;else if(n[a]===e[1]&&(t--,t<0))return a;return t>0?-2:-1}function pe(n,e=0){let t=e,a="";for(let s of n)if(s===" "){let o=4-t%4;a+=" ".repeat(o),t+=o}else a+=s,t++;return a}function ue(n,e,t,a,s){let o=e.href,l=e.title||null,i=n[1].replace(s.other.outputLinkReplace,"$1"),r=n[0].charAt(0)==="!";a.state.inLink=!0;let d=a.state.linkEmitted,h=a.state.inRawBlock;a.state.linkEmitted=!1;let u=a.inlineTokens(i),c=a.state.linkEmitted;if(a.state.linkEmitted=d,a.state.inLink=!1,!r){if(c){a.state.inRawBlock=h;return}a.state.linkEmitted=!0}return{type:r?"image":"link",raw:t,href:o,title:l,text:i,tokens:u}}function Lt(n,e,t){let a=n.match(t.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
|
|
|
|
| 1 |
+
var Ae=Object.defineProperty;var ze=(n,e,t)=>e in n?Ae(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var k=(n,e,t)=>ze(n,typeof e!="symbol"?e+"":e,t);import{T as Be,h as _e,u as Ie,n as Le}from"./index-DkdXqYYM.js";function K(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var z=K();function fe(n){z=n}var $={exec:()=>null};function B(n){let e=[];return t=>{let a=Math.max(0,Math.min(3,t-1)),s=e[a];return s||(s=n(a),e[a]=s),s}}function g(n,e=""){let t=typeof n=="string"?n:n.source,a={replace:(s,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(x.caret,"$1"),t=t.replace(s,l),a},getRegex:()=>new RegExp(t,e)};return a}var Pe=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),x={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:B(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:B(n=>new RegExp(`^ {0,${n}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:B(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:B(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:B(n=>new RegExp(`^ {0,${n}}(?:</?(?:${Q})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:B(n=>new RegExp(`^ {0,${n}}>`))},Ce=/^(?:[ \t]*(?:\n|$))+/,De=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ee=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,X=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ke=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,we=g(ke).replace(/bull/g,X).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qe=g(ke).replace(/bull/g,X).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),V=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,He=/^[^\n]+/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Oe=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ze=g(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,X).getRegex(),Q="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ge=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ee).replace("tag",Q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be=n=>g(V).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex(),Fe=be(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ne=be(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ue=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ne).getRegex(),te={blockquote:Ue,code:De,def:Oe,fences:Ee,heading:Qe,hr:E,html:Ge,lheading:we,list:Ze,newline:Ce,paragraph:Fe,table:$,text:He},re=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex(),je={...te,lheading:qe,table:re,paragraph:g(V).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex()},We={...te,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(V).replace("hr",E).replace("heading",` *#{1,6} *[^
|
| 2 |
]`).replace("lheading",we).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Je=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ke=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xe=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Xe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,_=/[\s\p{P}\p{S}]/u,q=/[^\s\p{P}\p{S}]/u,Ve=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_).getRegex(),Ye=/[\p{Pi}\p{Ps}"']/u,ye=/(?!~)[\p{P}\p{S}]/u,et=/(?!~)[\s\p{P}\p{S}]/u,tt=/(?:[^\s\p{P}\p{S}]|~)/u,nt=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Se=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,st=g(Se,"u").replace(/punct/g,T).getRegex(),at=g(Se,"u").replace(/punct/g,ye).getRegex(),rt=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,ot=g(rt,"u").replace(/openQuote/g,Ye).replace(/punct/g,T).getRegex(),Me="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lt=g(Me,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),it=g(Me,"gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,et).replace(/punct/g,ye).getRegex(),ht="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",ct=g(ht,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),dt=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),pt="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",ut=g(pt,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),gt=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),mt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ft=g(mt,"gu").replace(/notPunctSpace/g,q).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),kt=g(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),wt=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bt=g(ee).replace("(?:-->|$)","-->").getRegex(),xt=g("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Te=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Z=g(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Te).getRegex(),yt=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Z).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),St=g(/^!?\[(label)\]\[(ref)\]/).replace("label",Z).replace("ref",Y).getRegex(),Mt=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),oe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Tt=g(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Te).getRegex(),vt=g("reflink|nolink(?!\\()","g").replace("reflink",g(/^!?\[(label)\]\[(ref)\]/).replace("label",Tt).replace("ref",oe).getRegex()).replace("nolink",g(/^!?\[(ref)\](?:\[\])?/).replace("ref",oe).getRegex()).getRegex(),le=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Rt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,$t=g(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Rt).getRegex(),ne={_backpedal:$,anyPunctuation:kt,autolink:wt,blockSkip:nt,br:xe,code:Ke,del:$,delLDelim:$,delRDelim:$,emStrongLDelim:st,emStrongRDelimAst:lt,emStrongRDelimUnd:dt,escape:Je,link:yt,nolink:Mt,punctuation:Ve,reflink:St,reflinkSearch:vt,tag:xt,text:Xe,url:$},At={...ne,emStrongLDelim:ot,emStrongRDelimAst:ct,emStrongRDelimUnd:ut,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",Z).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z).getRegex()},j={...ne,emStrongRDelimAst:it,emStrongLDelim:at,delLDelim:gt,delRDelim:ft,url:g(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",$t).replace("protocol",le).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",le).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},zt={...j,br:g(xe).replace("{2,}","*").getRegex(),text:g(j.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},H={normal:te,gfm:je,pedantic:We},C={normal:ne,gfm:j,breaks:zt,pedantic:At},Bt={"&":"&","<":"<",">":">",'"':""","'":"'"},ie=n=>Bt[n];function y(n,e){if(e){if(x.escapeTest.test(n))return n.replace(x.escapeReplace,ie)}else if(x.escapeTestNoEncode.test(n))return n.replace(x.escapeReplaceNoEncode,ie);return n}function _t(n){return n.replace(x.numericCharacterReference,(e,t,a)=>{let s=t===void 0?Number.parseInt(a,16):Number.parseInt(t,10);return s===0||s>1114111||s>=55296&&s<=57343?"�":String.fromCodePoint(s)})}function he(n){try{n=encodeURI(n).replace(x.percentDecode,"%")}catch{return null}return n}function ce(n,e){var o;let t=n.replace(x.findPipe,(l,i,r)=>{let d=!1,h=i;for(;--h>=0&&r[h]==="\\";)d=!d;return d?"|":" |"}),a=t.split(x.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!((o=a.at(-1))!=null&&o.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(x.slashPipe,"|");return a}function R(n,e,t){let a=n.length;if(a===0)return"";let s=0;for(;s<a&&n.charAt(a-s-1)===e;)s++;return n.slice(0,a-s)}function de(n){let e=n.split(`
|
| 3 |
`),t=e.length-1;for(;t>=0&&x.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
|
| 4 |
`)}function G(n){return n.trim().toLowerCase().toUpperCase().toLowerCase()}function It(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let a=0;a<n.length;a++)if(n[a]==="\\")a++;else if(n[a]===e[0])t++;else if(n[a]===e[1]&&(t--,t<0))return a;return t>0?-2:-1}function pe(n,e=0){let t=e,a="";for(let s of n)if(s===" "){let o=4-t%4;a+=" ".repeat(o),t+=o}else a+=s,t++;return a}function ue(n,e,t,a,s){let o=e.href,l=e.title||null,i=n[1].replace(s.other.outputLinkReplace,"$1"),r=n[0].charAt(0)==="!";a.state.inLink=!0;let d=a.state.linkEmitted,h=a.state.inRawBlock;a.state.linkEmitted=!1;let u=a.inlineTokens(i),c=a.state.linkEmitted;if(a.state.linkEmitted=d,a.state.inLink=!1,!r){if(c){a.state.inRawBlock=h;return}a.state.linkEmitted=!0}return{type:r?"image":"link",raw:t,href:o,title:l,text:i,tokens:u}}function Lt(n,e,t){let a=n.match(t.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
|
assets/{Repos-CzEdbBgP.js → Repos-CRWthO8e.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as p,h as U,k as T,n as _,T as D,l as w,w as P,m as V,p as W,u as e,t as H,f as c,b as $,o as X,q as J,C as j,j as S,W as z,U as I,S as M,a as A,B,i as Q,r as ee,v as se,s as le,L as ae}from"./index-CvpbkKT6.js";const K={"3M":91,"6M":182,"1Y":365,All:null},O=i=>getComputedStyle(document.documentElement).getPropertyValue(i).trim(),ie=()=>e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#ff6b81","aria-hidden":"true",children:e("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})});function N(i,s,d){return D(()=>{if(d)return d;const r=K[s];if(!r||!i.length||!i[0].t.length)return null;const h=i[0].t[i[0].t.length-1];return[h-r*86400,h]},[i,s,d])}function Z({value:i,onChange:s}){return e("div",{class:"seg",role:"group","aria-label":"Time range",children:Object.keys(K).map(d=>e("button",{"aria-pressed":i===d,onClick:()=>s(d),children:d},d))})}function Y({route:i,text:s}){const d=le(i);return e("section",{class:"section",children:e("div",{class:"wrap w-actions g-actions",children:[e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(s)}&url=${encodeURIComponent(d)}`,children:"Post on X"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(d)}`,children:"LinkedIn"}),e("button",{class:"btn",onClick:()=>{var r;return(r=navigator.clipboard)==null?void 0:r.writeText(d)},children:"Copy link"}),e(ae,{})]})})}function G({id:i,space:s}){return e("div",{class:"wrap hero",children:[e("div",{class:"crumbs",style:{visibility:"hidden"},children:e("span",{class:"chip",children:"loading"})}),e("h1",{class:`model-name${s?" sp-title":""}`,children:s?i.split("/").pop():i}),s&&e("p",{class:"sp-id",children:i}),e("div",{class:"skeleton",style:{marginTop:24}})]})}function q({id:i,err:s}){return e("div",{class:"wrap err",children:[e("h1",{children:["No history for ",i]}),e("p",{class:"muted",children:s})]})}function te({id:i}){const[s,d]=i.includes("/")?[i.split("/")[0],i.split("/").slice(1).join("/")]:[null,i];return e("h1",{class:"model-name",children:[s&&e("a",{href:A({author:s}),onClick:r=>{r.preventDefault(),_({author:s})},class:"org",children:[s,"/"]}),s&&e("wbr",{}),e("span",{class:"hl",children:d})]})}function ne({id:i}){const[s,d]=p("month"),r=`${B}/badge/dataset/${i}.svg${s==="month"?"":`?metric=${s}`}`,h=`[](${ee}?dataset=${i})`;return e("section",{class:"section",children:e("div",{class:"wrap",children:e("div",{class:"card ds-badge",children:[e("h3",{children:"Badge for your dataset card"}),e("p",{children:["Updates daily. Paste it into the README of ",i.split("/").pop(),"."]}),e("div",{class:"seg badge-opts",role:"group","aria-label":"Badge metric",children:[e("button",{"aria-pressed":s==="month",onClick:()=>d("month"),children:"Monthly"}),e("button",{"aria-pressed":s==="all",onClick:()=>d("all"),children:"All time"}),e("button",{"aria-pressed":s==="likes",onClick:()=>d("likes"),children:"Likes"})]}),e("div",{class:"badge-preview",children:e("img",{src:r.replace(B,Q),alt:"Model Pulse badge preview",height:22})}),e("div",{class:"code",children:[e("code",{children:h}),e(se,{text:h,label:"Copy markdown"})]})]})})})}function ce({id:i}){const[s,d]=p(null),[r,h]=p(null),[o,C]=p("weekly"),[b,L]=p("1Y"),[x,u]=p(null),g=n=>{u(null),C(n)};U(()=>{d(null),h(null),T.dataset(i).then(n=>{d(n),n.dataset.id!==i&&_({dataset:n.dataset.id},!0),document.title=`${n.dataset.id} downloads: daily history and stats · Model Pulse`}).catch(n=>h(n.message))},[i]);const k=!!s&&s.series.dl_all.filter(n=>n!=null).length>7,l=(o==="weekly"||o==="daily")&&!k?"month":o,v=D(()=>{if(!s)return[];const n=s.series,R=O("--c1");if(l==="weekly"){const f=w(n.day,n.dl_all),F=P(f.t,f.v);return[{label:s.dataset.id,color:R,t:F.t,v:F.v,fill:!0}]}if(l==="daily"){const f=w(n.day,n.dl_all);return[{label:s.dataset.id,color:R,t:f.t,v:V(f.v,7),fill:!0}]}const E=W(n.day,l==="month"?n.dl30:l==="total"?n.dl_all:n.likes);return[{label:s.dataset.id,color:R,t:E.t,v:E.v,fill:!0}]},[s,l]),t=D(()=>s&&l==="weekly"?P(w(s.series.day,s.series.dl_all).t,w(s.series.day,s.series.dl_all).v).partial:!1,[s,l]),m=N(v,b,x);if(r)return e(q,{id:i,err:r});if(!s)return e(G,{id:i});const a=s.dataset,y=a.id.split("/").pop();return e(M,{children:[e("div",{class:"wrap hero",children:[e("div",{class:"crumbs",children:[e("span",{class:"chip chip-kind",children:"Dataset"}),a.pipeline_tag&&e("span",{class:"chip",children:H(a.pipeline_tag)}),a.size&&e("span",{class:"chip",children:[a.size," rows"]}),a.license&&e("span",{class:"chip",children:a.license}),a.likes!=null&&e("span",{class:"chip",children:[e(ie,{}),c(a.likes)," likes",a.likes_7d?e("span",{class:"up",children:["+",c(a.likes_7d)]}):null]}),e("a",{class:"chip",href:`https://huggingface.co/datasets/${a.id}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),e(te,{id:a.id}),e("div",{class:"card stats",style:{padding:0},children:[e("div",{class:"fig fig-main",children:[e("div",{class:"num",children:c(a.dl_all??a.dl30)}),e("div",{class:"label",children:a.dl_all!=null?"downloads all time":"downloads in the last 30 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:$(a.dl30)}),e("div",{class:"label",children:"last 30 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:[$(a.dl_7d),a.growth_7d!=null&&e("small",{class:a.growth_7d>=0?"up":"down",children:X(a.growth_7d)})]}),e("div",{class:"label",children:["last 7 days",a.growth_7d!=null?", vs. 3-week average":""]})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["#",c(a.rank_dl30)]}),e("div",{class:"label",children:["among datasets",a.rank_task&&a.pipeline_tag?`, ${J(a.rank_task)} in ${H(a.pipeline_tag)}`:""]})]})]}),e("div",{class:"card chart-card",children:[e("div",{class:"chart-bar",children:e("div",{class:"left",children:[e("div",{class:"seg",role:"group","aria-label":"Metric",children:[k&&e("button",{"aria-pressed":l==="weekly",onClick:()=>g("weekly"),children:"Weekly"}),k&&e("button",{"aria-pressed":l==="daily",onClick:()=>g("daily"),children:"Daily"}),e("button",{"aria-pressed":l==="month",onClick:()=>g("month"),children:"Rolling 30 days"}),k&&e("button",{"aria-pressed":l==="total",onClick:()=>g("total"),children:"All time"}),e("button",{"aria-pressed":l==="likes",onClick:()=>g("likes"),children:"Likes"})]}),e(Z,{value:b,onChange:n=>{u(null),L(n)}})]})}),e(j,{lines:v,range:m,onZoom:u,height:360,bars:l==="weekly",partialLast:l==="weekly"&&!!t,endLabel:l!=="weekly",tipDate:l==="weekly"?n=>`Week of ${S(new Date((n-z/2)*1e3),{month:"short",day:"numeric",year:"numeric"})}`:void 0,valueLabel:l==="daily"?n=>c(n)+"/day":l==="weekly"?n=>c(n)+"/week":void 0}),e("p",{class:"chart-note",children:[l==="weekly"&&"Downloads per week, Monday to Sunday; the striped bar is the week in progress. ",l==="daily"&&"7-day average of daily downloads. ","Dataset downloads follow the Hub's counting rules. Drag on the chart to zoom, double-click to reset."]})]})]}),(s.models.count>0||s.spaces.count>0)&&e("section",{class:"section",children:e("div",{class:"wrap",children:[e("div",{class:"section-head",children:e("div",{children:[e("h2",{children:["Who uses ",y]}),e("p",{children:["Models whose card lists ",y," as training data, and Spaces whose card lists it."]})]})}),e("div",{class:"ub-grid",children:[e(I,{title:"Models trained on it",data:s.models,by:"model",note:"Counted from today's model cards, by the month each model was created."}),e(I,{title:"Spaces using it",data:s.spaces,by:"space",note:"Counted from today's Space cards, by the month each Space was created."})]})]})}),e("section",{class:"section",children:e("div",{class:"wrap about",children:[e("h2",{children:["About ",y]}),e("p",{children:[e("b",{children:a.id})," is a",/^[aeio]/i.test(a.pipeline_tag??"")?"n":""," ",a.pipeline_tag?`${H(a.pipeline_tag)} `:"","dataset on the Hugging Face Hub."," ","In the last 30 days it was downloaded ",e("b",{children:c(a.dl30)})," times",a.dl_all?e(M,{children:[", and ",e("b",{children:c(a.dl_all)})," times in total"]}):null,".",a.rank_dl30?` It ranks #${c(a.rank_dl30)} among datasets by monthly downloads.`:"",a.used_by_models?` ${c(a.used_by_models)} models list it as training data`:"",a.used_by_models&&a.used_by_spaces?`, and ${c(a.used_by_spaces)} Spaces use it.`:a.used_by_models?".":a.used_by_spaces?` ${c(a.used_by_spaces)} Spaces use it.`:""]}),a.description&&e("p",{class:"muted",children:[a.description,a.description.length>=300?"…":""]})]})}),e(ne,{id:a.id}),e(Y,{route:{dataset:a.id},text:`${a.id} has ${$(a.dl_all??a.dl30)} downloads on Hugging Face. Full download history:`})]})}function re({id:i}){const[s,d]=p(null),[r,h]=p(null),[o,C]=p("weekly"),[b,L]=p("1Y"),[x,u]=p(null);U(()=>{d(null),h(null),T.space(i).then(t=>{d(t),t.space.id!==i&&_({space:t.space.id},!0),document.title=`${t.space.title||t.space.id}: likes over time · Model Pulse`}).catch(t=>h(t.message))},[i]);const g=D(()=>{if(!s)return[];const t=O("--c3");if(o==="total"){const y=W(s.series.day,s.series.likes);return[{label:s.space.id,color:t,t:y.t,v:y.v,fill:!0}]}const m=w(s.series.day,s.series.likes),a=P(m.t,m.v);return[{label:s.space.id,color:t,t:a.t,v:a.v,fill:!0}]},[s,o]),k=N(g,b,x);if(r)return e(q,{id:i,err:r});if(!s)return e(G,{id:i,space:!0});const l=s.space,v=[...s.uses.models.map(t=>({...t,kind:"model"})),...s.uses.datasets.map(t=>({...t,kind:"dataset"}))];return e(M,{children:[e("div",{class:"wrap hero",children:[e("div",{class:"crumbs",children:[e("span",{class:"chip chip-kind",children:"Space"}),l.sdk&&e("span",{class:"chip",children:l.sdk}),l.created_at&&e("span",{class:"chip",children:["since ",S(l.created_at,{month:"short",year:"numeric"})]}),e("a",{class:"chip",href:`https://huggingface.co/spaces/${l.id}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),e("h1",{class:"model-name sp-title",children:[l.emoji&&e("span",{class:"emo","aria-hidden":"true",children:l.emoji}),e("span",{class:"hl",children:l.title||l.id.split("/").pop()})]}),e("p",{class:"sp-id",children:[e("a",{href:A({author:l.id.split("/")[0]}),onClick:t=>{t.preventDefault(),_({author:l.id.split("/")[0]})},children:l.id.split("/")[0]}),"/",l.id.split("/").slice(1).join("/"),l.short_description?e(M,{children:[" · ",l.short_description]}):null]}),e("div",{class:"card stats",style:{padding:0},children:[e("div",{class:"fig fig-main",children:[e("div",{class:"num",children:c(l.likes)}),e("div",{class:"label",children:"likes"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["+",c(l.likes_7d)]}),e("div",{class:"label",children:"last 7 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["+",c(l.likes_30d)]}),e("div",{class:"label",children:"last 30 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["#",c(l.rank_likes)]}),e("div",{class:"label",children:"among Spaces by likes"})]})]}),e("div",{class:"card chart-card",children:[e("div",{class:"chart-bar",children:e("div",{class:"left",children:[e("div",{class:"seg",role:"group","aria-label":"Metric",children:[e("button",{"aria-pressed":o==="weekly",onClick:()=>{u(null),C("weekly")},children:"Likes per week"}),e("button",{"aria-pressed":o==="total",onClick:()=>{u(null),C("total")},children:"Total likes"})]}),e(Z,{value:b,onChange:t=>{u(null),L(t)}})]})}),e(j,{lines:g,range:k,onZoom:u,height:340,bars:o==="weekly",endLabel:o!=="weekly",tipDate:o==="weekly"?t=>`Week of ${S(new Date((t-z/2)*1e3),{month:"short",day:"numeric",year:"numeric"})}`:void 0,valueLabel:o==="weekly"?t=>`+${c(t)} likes`:t=>`${c(t)} likes`}),e("p",{class:"chart-note",children:"The Hub doesn't publish visits or usage for Spaces, so likes are the measure here. Drag on the chart to zoom, double-click to reset."})]})]}),v.length>0&&e("section",{class:"section",children:e("div",{class:"wrap",children:[e("div",{class:"section-head",children:e("div",{children:[e("h2",{children:"What it uses"}),e("p",{children:"Models and datasets listed in this Space's card, by downloads in the last 30 days."})]})}),e("div",{class:"card",children:e("ol",{class:"ub-list",children:v.map(t=>{const m=t.kind==="model"?{model:t.id}:{dataset:t.id};return e("li",{children:e("a",{href:A(m),onClick:a=>{a.preventDefault(),_(m)},children:[e("span",{class:`kind k-${t.kind}`,children:t.kind}),e("span",{class:"nm",children:t.id}),e("span",{class:"v",children:t.dl30!=null?`${$(t.dl30)}/mo`:"not tracked"})]})},`${t.kind}:${t.id}`)})})})]})}),e("section",{class:"section",children:e("div",{class:"wrap about",children:[e("h2",{children:["About ",l.title||l.id]}),e("p",{children:[e("b",{children:l.id})," is a",l.sdk&&/^[aeio]/i.test(l.sdk)?"n":""," ",l.sdk?`${l.sdk} `:"","Space on the Hugging Face Hub",l.created_at?`, created in ${S(l.created_at,{month:"long",year:"numeric"})}`:"","."," ","It has ",e("b",{children:c(l.likes)})," likes, ",c(l.likes_7d)," of them in the last 7 days and ",c(l.likes_30d)," in the last 30, and ranks #",c(l.rank_likes)," among Spaces by likes.",v.length?` Its card lists ${c(s.uses.models.length)} model${s.uses.models.length===1?"":"s"} and ${c(s.uses.datasets.length)} dataset${s.uses.datasets.length===1?"":"s"}.`:""]})]})}),e(Y,{route:{space:l.id},text:`${l.title||l.id} has ${$(l.likes)} likes on Hugging Face. Likes over time:`})]})}export{ce as DatasetPage,re as SpacePage};
|
|
|
|
| 1 |
+
import{d as p,h as U,k as T,n as _,T as D,l as w,w as P,m as V,p as W,u as e,t as H,f as c,b as $,o as X,q as J,C as j,j as S,W as z,U as I,S as M,a as A,B,i as Q,r as ee,v as se,s as le,L as ae}from"./index-DkdXqYYM.js";const K={"3M":91,"6M":182,"1Y":365,All:null},O=i=>getComputedStyle(document.documentElement).getPropertyValue(i).trim(),ie=()=>e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#ff6b81","aria-hidden":"true",children:e("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})});function N(i,s,d){return D(()=>{if(d)return d;const r=K[s];if(!r||!i.length||!i[0].t.length)return null;const h=i[0].t[i[0].t.length-1];return[h-r*86400,h]},[i,s,d])}function Z({value:i,onChange:s}){return e("div",{class:"seg",role:"group","aria-label":"Time range",children:Object.keys(K).map(d=>e("button",{"aria-pressed":i===d,onClick:()=>s(d),children:d},d))})}function Y({route:i,text:s}){const d=le(i);return e("section",{class:"section",children:e("div",{class:"wrap w-actions g-actions",children:[e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(s)}&url=${encodeURIComponent(d)}`,children:"Post on X"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(d)}`,children:"LinkedIn"}),e("button",{class:"btn",onClick:()=>{var r;return(r=navigator.clipboard)==null?void 0:r.writeText(d)},children:"Copy link"}),e(ae,{})]})})}function G({id:i,space:s}){return e("div",{class:"wrap hero",children:[e("div",{class:"crumbs",style:{visibility:"hidden"},children:e("span",{class:"chip",children:"loading"})}),e("h1",{class:`model-name${s?" sp-title":""}`,children:s?i.split("/").pop():i}),s&&e("p",{class:"sp-id",children:i}),e("div",{class:"skeleton",style:{marginTop:24}})]})}function q({id:i,err:s}){return e("div",{class:"wrap err",children:[e("h1",{children:["No history for ",i]}),e("p",{class:"muted",children:s})]})}function te({id:i}){const[s,d]=i.includes("/")?[i.split("/")[0],i.split("/").slice(1).join("/")]:[null,i];return e("h1",{class:"model-name",children:[s&&e("a",{href:A({author:s}),onClick:r=>{r.preventDefault(),_({author:s})},class:"org",children:[s,"/"]}),s&&e("wbr",{}),e("span",{class:"hl",children:d})]})}function ne({id:i}){const[s,d]=p("month"),r=`${B}/badge/dataset/${i}.svg${s==="month"?"":`?metric=${s}`}`,h=`[](${ee}?dataset=${i})`;return e("section",{class:"section",children:e("div",{class:"wrap",children:e("div",{class:"card ds-badge",children:[e("h3",{children:"Badge for your dataset card"}),e("p",{children:["Updates daily. Paste it into the README of ",i.split("/").pop(),"."]}),e("div",{class:"seg badge-opts",role:"group","aria-label":"Badge metric",children:[e("button",{"aria-pressed":s==="month",onClick:()=>d("month"),children:"Monthly"}),e("button",{"aria-pressed":s==="all",onClick:()=>d("all"),children:"All time"}),e("button",{"aria-pressed":s==="likes",onClick:()=>d("likes"),children:"Likes"})]}),e("div",{class:"badge-preview",children:e("img",{src:r.replace(B,Q),alt:"Model Pulse badge preview",height:22})}),e("div",{class:"code",children:[e("code",{children:h}),e(se,{text:h,label:"Copy markdown"})]})]})})})}function ce({id:i}){const[s,d]=p(null),[r,h]=p(null),[o,C]=p("weekly"),[b,L]=p("1Y"),[x,u]=p(null),g=n=>{u(null),C(n)};U(()=>{d(null),h(null),T.dataset(i).then(n=>{d(n),n.dataset.id!==i&&_({dataset:n.dataset.id},!0),document.title=`${n.dataset.id} downloads: daily history and stats · Model Pulse`}).catch(n=>h(n.message))},[i]);const k=!!s&&s.series.dl_all.filter(n=>n!=null).length>7,l=(o==="weekly"||o==="daily")&&!k?"month":o,v=D(()=>{if(!s)return[];const n=s.series,R=O("--c1");if(l==="weekly"){const f=w(n.day,n.dl_all),F=P(f.t,f.v);return[{label:s.dataset.id,color:R,t:F.t,v:F.v,fill:!0}]}if(l==="daily"){const f=w(n.day,n.dl_all);return[{label:s.dataset.id,color:R,t:f.t,v:V(f.v,7),fill:!0}]}const E=W(n.day,l==="month"?n.dl30:l==="total"?n.dl_all:n.likes);return[{label:s.dataset.id,color:R,t:E.t,v:E.v,fill:!0}]},[s,l]),t=D(()=>s&&l==="weekly"?P(w(s.series.day,s.series.dl_all).t,w(s.series.day,s.series.dl_all).v).partial:!1,[s,l]),m=N(v,b,x);if(r)return e(q,{id:i,err:r});if(!s)return e(G,{id:i});const a=s.dataset,y=a.id.split("/").pop();return e(M,{children:[e("div",{class:"wrap hero",children:[e("div",{class:"crumbs",children:[e("span",{class:"chip chip-kind",children:"Dataset"}),a.pipeline_tag&&e("span",{class:"chip",children:H(a.pipeline_tag)}),a.size&&e("span",{class:"chip",children:[a.size," rows"]}),a.license&&e("span",{class:"chip",children:a.license}),a.likes!=null&&e("span",{class:"chip",children:[e(ie,{}),c(a.likes)," likes",a.likes_7d?e("span",{class:"up",children:["+",c(a.likes_7d)]}):null]}),e("a",{class:"chip",href:`https://huggingface.co/datasets/${a.id}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),e(te,{id:a.id}),e("div",{class:"card stats",style:{padding:0},children:[e("div",{class:"fig fig-main",children:[e("div",{class:"num",children:c(a.dl_all??a.dl30)}),e("div",{class:"label",children:a.dl_all!=null?"downloads all time":"downloads in the last 30 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:$(a.dl30)}),e("div",{class:"label",children:"last 30 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:[$(a.dl_7d),a.growth_7d!=null&&e("small",{class:a.growth_7d>=0?"up":"down",children:X(a.growth_7d)})]}),e("div",{class:"label",children:["last 7 days",a.growth_7d!=null?", vs. 3-week average":""]})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["#",c(a.rank_dl30)]}),e("div",{class:"label",children:["among datasets",a.rank_task&&a.pipeline_tag?`, ${J(a.rank_task)} in ${H(a.pipeline_tag)}`:""]})]})]}),e("div",{class:"card chart-card",children:[e("div",{class:"chart-bar",children:e("div",{class:"left",children:[e("div",{class:"seg",role:"group","aria-label":"Metric",children:[k&&e("button",{"aria-pressed":l==="weekly",onClick:()=>g("weekly"),children:"Weekly"}),k&&e("button",{"aria-pressed":l==="daily",onClick:()=>g("daily"),children:"Daily"}),e("button",{"aria-pressed":l==="month",onClick:()=>g("month"),children:"Rolling 30 days"}),k&&e("button",{"aria-pressed":l==="total",onClick:()=>g("total"),children:"All time"}),e("button",{"aria-pressed":l==="likes",onClick:()=>g("likes"),children:"Likes"})]}),e(Z,{value:b,onChange:n=>{u(null),L(n)}})]})}),e(j,{lines:v,range:m,onZoom:u,height:360,bars:l==="weekly",partialLast:l==="weekly"&&!!t,endLabel:l!=="weekly",tipDate:l==="weekly"?n=>`Week of ${S(new Date((n-z/2)*1e3),{month:"short",day:"numeric",year:"numeric"})}`:void 0,valueLabel:l==="daily"?n=>c(n)+"/day":l==="weekly"?n=>c(n)+"/week":void 0}),e("p",{class:"chart-note",children:[l==="weekly"&&"Downloads per week, Monday to Sunday; the striped bar is the week in progress. ",l==="daily"&&"7-day average of daily downloads. ","Dataset downloads follow the Hub's counting rules. Drag on the chart to zoom, double-click to reset."]})]})]}),(s.models.count>0||s.spaces.count>0)&&e("section",{class:"section",children:e("div",{class:"wrap",children:[e("div",{class:"section-head",children:e("div",{children:[e("h2",{children:["Who uses ",y]}),e("p",{children:["Models whose card lists ",y," as training data, and Spaces whose card lists it."]})]})}),e("div",{class:"ub-grid",children:[e(I,{title:"Models trained on it",data:s.models,by:"model",note:"Counted from today's model cards, by the month each model was created."}),e(I,{title:"Spaces using it",data:s.spaces,by:"space",note:"Counted from today's Space cards, by the month each Space was created."})]})]})}),e("section",{class:"section",children:e("div",{class:"wrap about",children:[e("h2",{children:["About ",y]}),e("p",{children:[e("b",{children:a.id})," is a",/^[aeio]/i.test(a.pipeline_tag??"")?"n":""," ",a.pipeline_tag?`${H(a.pipeline_tag)} `:"","dataset on the Hugging Face Hub."," ","In the last 30 days it was downloaded ",e("b",{children:c(a.dl30)})," times",a.dl_all?e(M,{children:[", and ",e("b",{children:c(a.dl_all)})," times in total"]}):null,".",a.rank_dl30?` It ranks #${c(a.rank_dl30)} among datasets by monthly downloads.`:"",a.used_by_models?` ${c(a.used_by_models)} models list it as training data`:"",a.used_by_models&&a.used_by_spaces?`, and ${c(a.used_by_spaces)} Spaces use it.`:a.used_by_models?".":a.used_by_spaces?` ${c(a.used_by_spaces)} Spaces use it.`:""]}),a.description&&e("p",{class:"muted",children:[a.description,a.description.length>=300?"…":""]})]})}),e(ne,{id:a.id}),e(Y,{route:{dataset:a.id},text:`${a.id} has ${$(a.dl_all??a.dl30)} downloads on Hugging Face. Full download history:`})]})}function re({id:i}){const[s,d]=p(null),[r,h]=p(null),[o,C]=p("weekly"),[b,L]=p("1Y"),[x,u]=p(null);U(()=>{d(null),h(null),T.space(i).then(t=>{d(t),t.space.id!==i&&_({space:t.space.id},!0),document.title=`${t.space.title||t.space.id}: likes over time · Model Pulse`}).catch(t=>h(t.message))},[i]);const g=D(()=>{if(!s)return[];const t=O("--c3");if(o==="total"){const y=W(s.series.day,s.series.likes);return[{label:s.space.id,color:t,t:y.t,v:y.v,fill:!0}]}const m=w(s.series.day,s.series.likes),a=P(m.t,m.v);return[{label:s.space.id,color:t,t:a.t,v:a.v,fill:!0}]},[s,o]),k=N(g,b,x);if(r)return e(q,{id:i,err:r});if(!s)return e(G,{id:i,space:!0});const l=s.space,v=[...s.uses.models.map(t=>({...t,kind:"model"})),...s.uses.datasets.map(t=>({...t,kind:"dataset"}))];return e(M,{children:[e("div",{class:"wrap hero",children:[e("div",{class:"crumbs",children:[e("span",{class:"chip chip-kind",children:"Space"}),l.sdk&&e("span",{class:"chip",children:l.sdk}),l.created_at&&e("span",{class:"chip",children:["since ",S(l.created_at,{month:"short",year:"numeric"})]}),e("a",{class:"chip",href:`https://huggingface.co/spaces/${l.id}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),e("h1",{class:"model-name sp-title",children:[l.emoji&&e("span",{class:"emo","aria-hidden":"true",children:l.emoji}),e("span",{class:"hl",children:l.title||l.id.split("/").pop()})]}),e("p",{class:"sp-id",children:[e("a",{href:A({author:l.id.split("/")[0]}),onClick:t=>{t.preventDefault(),_({author:l.id.split("/")[0]})},children:l.id.split("/")[0]}),"/",l.id.split("/").slice(1).join("/"),l.short_description?e(M,{children:[" · ",l.short_description]}):null]}),e("div",{class:"card stats",style:{padding:0},children:[e("div",{class:"fig fig-main",children:[e("div",{class:"num",children:c(l.likes)}),e("div",{class:"label",children:"likes"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["+",c(l.likes_7d)]}),e("div",{class:"label",children:"last 7 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["+",c(l.likes_30d)]}),e("div",{class:"label",children:"last 30 days"})]}),e("div",{class:"fig",children:[e("div",{class:"val",children:["#",c(l.rank_likes)]}),e("div",{class:"label",children:"among Spaces by likes"})]})]}),e("div",{class:"card chart-card",children:[e("div",{class:"chart-bar",children:e("div",{class:"left",children:[e("div",{class:"seg",role:"group","aria-label":"Metric",children:[e("button",{"aria-pressed":o==="weekly",onClick:()=>{u(null),C("weekly")},children:"Likes per week"}),e("button",{"aria-pressed":o==="total",onClick:()=>{u(null),C("total")},children:"Total likes"})]}),e(Z,{value:b,onChange:t=>{u(null),L(t)}})]})}),e(j,{lines:g,range:k,onZoom:u,height:340,bars:o==="weekly",endLabel:o!=="weekly",tipDate:o==="weekly"?t=>`Week of ${S(new Date((t-z/2)*1e3),{month:"short",day:"numeric",year:"numeric"})}`:void 0,valueLabel:o==="weekly"?t=>`+${c(t)} likes`:t=>`${c(t)} likes`}),e("p",{class:"chart-note",children:"The Hub doesn't publish visits or usage for Spaces, so likes are the measure here. Drag on the chart to zoom, double-click to reset."})]})]}),v.length>0&&e("section",{class:"section",children:e("div",{class:"wrap",children:[e("div",{class:"section-head",children:e("div",{children:[e("h2",{children:"What it uses"}),e("p",{children:"Models and datasets listed in this Space's card, by downloads in the last 30 days."})]})}),e("div",{class:"card",children:e("ol",{class:"ub-list",children:v.map(t=>{const m=t.kind==="model"?{model:t.id}:{dataset:t.id};return e("li",{children:e("a",{href:A(m),onClick:a=>{a.preventDefault(),_(m)},children:[e("span",{class:`kind k-${t.kind}`,children:t.kind}),e("span",{class:"nm",children:t.id}),e("span",{class:"v",children:t.dl30!=null?`${$(t.dl30)}/mo`:"not tracked"})]})},`${t.kind}:${t.id}`)})})})]})}),e("section",{class:"section",children:e("div",{class:"wrap about",children:[e("h2",{children:["About ",l.title||l.id]}),e("p",{children:[e("b",{children:l.id})," is a",l.sdk&&/^[aeio]/i.test(l.sdk)?"n":""," ",l.sdk?`${l.sdk} `:"","Space on the Hugging Face Hub",l.created_at?`, created in ${S(l.created_at,{month:"long",year:"numeric"})}`:"","."," ","It has ",e("b",{children:c(l.likes)})," likes, ",c(l.likes_7d)," of them in the last 7 days and ",c(l.likes_30d)," in the last 30, and ranks #",c(l.rank_likes)," among Spaces by likes.",v.length?` Its card lists ${c(s.uses.models.length)} model${s.uses.models.length===1?"":"s"} and ${c(s.uses.datasets.length)} dataset${s.uses.datasets.length===1?"":"s"}.`:""]})]})}),e(Y,{route:{space:l.id},text:`${l.title||l.id} has ${$(l.likes)} likes on Hugging Face. Likes over time:`})]})}export{ce as DatasetPage,re as SpacePage};
|
assets/{Wrapped-BJHyvcz7.js → Wrapped-C2RX65Nw.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as $,A as se,h as U,i as te,u as e,c as z,s as ne,b as k,n as L,f,a as j,L as le,S as w,j as Y,k as K}from"./index-CvpbkKT6.js";const b=s=>s.kind==="datasets",S=(s,l=2)=>(b(s)?"dataset":"model")+(l===1?"":"s"),oe=["zero","one","two","three","four","five","six","seven","eight","nine"],N=s=>s.replace(/-/g," "),ae=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function D({to:s,run:l,format:n=f}){const[i,t]=$(0);return U(()=>{if(!l){t(0);return}if(ae()){t(s);return}let r=0;const d=performance.now(),y=1300,m=_=>{const o=Math.min(1,(_-d)/y);t(s*(1-Math.pow(1-o,3))),o<1&&(r=requestAnimationFrame(m))};return r=requestAnimationFrame(m),()=>cancelAnimationFrame(r)},[s,l]),e(w,{children:n(Math.round(i))})}const V=s=>{if(s.every_seconds>=1){const l=s.every_seconds;return l<60?`one download every ${l.toFixed(l<10?1:0)} seconds`:l<3600?`one download every ${Math.round(l/60)} minutes`:`one download every ${Math.round(l/3600)} hours`}return s.per_minute>=1e3?`${k(s.per_minute)} downloads every minute`:`${Math.round(s.per_minute)} downloads every minute`},A=s=>s.split("/").slice(1).join("/")||s,X=["#ffd21e","#fbfaf5","#ff8a1f","#3fd08a","#7fb1ff"],re=s=>{const l=s.tasks;if(!l||!l.top.length||!l.total_30d)return null;const n=l.top.reduce((t,r)=>t+r.downloads_30d,0);return n/l.total_30d<.3?null:{rows:l.top.map((t,r)=>({...t,share:t.downloads_30d/n,color:X[r%X.length]})),untagged:1-n/l.total_30d}},O=s=>s.downloads_all&&s.downloads_all>s.downloads?s.downloads_all:null,I=s=>s.rank<=10?"top 10":s.rank<=100?"top 100":s.rank<=1e3?"top 1,000":s.top_pct==null||s.top_pct>50?null:`top ${s.top_pct<1?s.top_pct.toFixed(1):Math.ceil(s.top_pct)}%`,ee=s=>{const l=new Date(s.period.to.slice(0,7)+"-01T00:00:00Z"),n=new Map(s.months.map(i=>[i.month.slice(0,7),i.downloads]));return Array.from({length:12},(i,t)=>{const d=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth()-12+t,1)).toISOString().slice(0,7);return{month:d,downloads:n.get(d)??0}})},H=s=>`${Y(s.period.from,{month:"short",year:"numeric"})} – ${Y(s.period.to,{month:"short",year:"numeric"})}`;function J({values:s,highlight:l,light:n}){const i=Math.max(...s,1);return e("div",{class:`w-bars${n?" light":""}`,"aria-hidden":"true",children:s.map((t,r)=>e("span",{class:r===l?"hi":"",style:{height:`${Math.max(3,t/i*100)}%`}},r))})}function Q(s,l){const n=o=>l===o,i=b(s)?re(s):null,t=["intro","downloads","top",...i?["mix"]:[],"week","ripple","rank"],r=o=>t.indexOf(o),d=t.length,y=s.weeks.map(o=>o.downloads),m=s.best_week?s.weeks.findIndex(o=>o.week_of===s.best_week.week_of):-1;return[{key:"intro",tone:"yellow",body:e(w,{children:[e("div",{class:"w-kicker",children:["Model Pulse Wrapped",b(s)&&e("span",{class:"w-edition",children:"datasets"})]}),e("div",{class:"w-logo",children:e(z,{size:88})}),e("h2",{class:"w-title",children:[e("span",{class:"w-name",children:s.author}),e("br",{}),"on the Hub"]}),e("p",{class:"w-sub",children:[b(s)?"Your datasets' last 12 months":"Your last 12 months",", in ",oe[d]??d," cards."]}),e("p",{class:"w-mono",children:H(s)})]})},{key:"downloads",tone:"blue",body:e(w,{children:[e("div",{class:"w-kicker",children:["Your ",S(s)," were downloaded"]}),O(s)?e(w,{children:[e("div",{class:"w-big",children:e(D,{to:O(s),run:n(1)})}),e("p",{class:"w-sub",children:["times in total. ",k(s.downloads)," of them in the last 12 months: ",V(s),"."]})]}):e(w,{children:[e("div",{class:"w-big",children:e(D,{to:s.downloads,run:n(1)})}),e("p",{class:"w-sub",children:["times. That's ",V(s),"."]})]}),e(J,{values:ee(s).map(o=>o.downloads),light:!0}),e("p",{class:"w-mono",children:O(s)?"last 12 months, by month":"downloads by month"})]})},{key:"top",tone:"paper",body:s.top_model?e(w,{children:[e("div",{class:"w-kicker",children:["Your #1 ",S(s,1)," this year"]}),e("h2",{class:"w-model",children:e("span",{children:A(s.top_model.id)})}),e("div",{class:"w-big sm",children:[e(D,{to:s.top_model.downloads,run:n(2),format:k})," ",e("small",{children:"downloads"})]}),e("p",{class:"w-sub",children:[Math.round(s.top_model.share*100),"% of everything you served",s.top_model.task?`, as ${N(s.top_model.task)}`:"","."]}),s.top_models.length>1&&e("ol",{class:"w-list",start:2,children:s.top_models.slice(1,5).map(o=>e("li",{children:[e("span",{children:A(o.id)}),e("b",{children:k(o.downloads)})]},o.id))})]}):e("p",{class:"w-sub",children:["No single ",S(s,1)," stood out this year."]})},...i?[{key:"mix",tone:"purple",body:e(w,{children:[e("div",{class:"w-kicker",children:"What your data is for"}),e("h2",{class:"w-title sm",children:i.rows[0].share>=.5?e(w,{children:["Mostly ",e("span",{class:"w-hl",children:N(i.rows[0].task)})]}):e(w,{children:["A bit of ",e("span",{class:"w-hl",children:"everything"})]})}),e("div",{class:`w-mix${n(3)?" run":""}`,"aria-hidden":"true",children:i.rows.map(o=>e("span",{style:{flexGrow:o.share,background:o.color}},o.task))}),e("ul",{class:"w-legend",children:i.rows.map(o=>e("li",{children:[e("i",{style:{background:o.color}}),e("span",{children:N(o.task)}),e("b",{children:[Math.round(o.share*100)||"<1","%"]}),e("small",{children:[f(o.datasets)," ",o.datasets===1?"dataset":"datasets"]})]},o.task))}),e("p",{class:"w-mono",children:["share of your downloads in the last 30 days, by task category",i.untagged>=.05?`. ${Math.round(i.untagged*100)}% come from datasets with no category`:""]})]})}]:[],{key:"week",tone:"orange",body:s.best_week?e(w,{children:[e("div",{class:"w-kicker",children:"Your biggest week"}),e("h2",{class:"w-title sm",children:["Week of ",Y(s.best_week.week_of,{month:"long",day:"numeric",year:"numeric"})]}),e("div",{class:"w-big",children:e(D,{to:s.best_week.downloads,run:n(r("week"))})}),e("p",{class:"w-sub",children:"downloads in seven days."}),e(J,{values:y,highlight:m})]}):e("p",{class:"w-sub",children:"Not enough weeks of data yet."})},b(s)?{key:"ripple",tone:"green",body:s.ripple.models>0||(s.ripple.spaces??0)>0?e(w,{children:[e("div",{class:"w-kicker",children:"Trained on your data"}),s.ripple.models>0?e(w,{children:[e("div",{class:"w-big",children:e(D,{to:s.ripple.models,run:n(r("ripple"))})}),e("p",{class:"w-sub",children:["model",s.ripple.models===1?"":"s"," by other people list",s.ripple.models===1?"s":""," your datasets as training data.",s.ripple.downloads_30d>0&&e(w,{children:[" ",s.ripple.models===1?"It was":"Together they were"," downloaded ",e("b",{children:k(s.ripple.downloads_30d)})," times last month."]})]}),s.ripple.top&&e("p",{class:"w-mono",children:[s.ripple.models>1?"the biggest: ":"",s.ripple.top.id,", trained on ",A(s.ripple.top.dataset??"")]}),(s.ripple.spaces??0)>0&&e("div",{class:"w-chips",children:e("span",{children:[f(s.ripple.spaces)," Space",s.ripple.spaces===1?"":"s"," use",s.ripple.spaces===1?"s":""," them too"]})})]}):e(w,{children:[e("div",{class:"w-big",children:e(D,{to:s.ripple.spaces,run:n(r("ripple"))})}),e("p",{class:"w-sub",children:["Space",s.ripple.spaces===1?"":"s"," by other people use",s.ripple.spaces===1?"s":""," your datasets. No model lists them as training data yet."]})]})]}):e(w,{children:[e("div",{class:"w-kicker",children:"Trained on your data"}),e("h2",{class:"w-title sm",children:"No models list it yet."}),e("p",{class:"w-sub",children:["When someone names one of your datasets in a model card's ",e("code",{children:"datasets:"})," field, that model shows up here. You published ",e("b",{children:s.models_new})," new dataset",s.models_new===1?"":"s"," this year; one of them could be next."]})]})}:{key:"ripple",tone:"green",body:s.ripple.models>0?e(w,{children:[e("div",{class:"w-kicker",children:"Your ripple effect"}),e("div",{class:"w-big",children:e(D,{to:s.ripple.models,run:n(r("ripple"))})}),e("p",{class:"w-sub",children:["models by other people build on yours. Together they were downloaded ",e("b",{children:k(s.ripple.downloads_30d)})," times last month."]}),s.ripple.top&&e("p",{class:"w-mono",children:["the biggest: ",s.ripple.top.id," (",s.ripple.top.relation,")"]})]}):e(w,{children:[e("div",{class:"w-kicker",children:"Your ripple effect"}),e("h2",{class:"w-title sm",children:"No derivatives yet."}),e("p",{class:"w-sub",children:["When someone quantizes or fine-tunes one of your models, it shows up here. You published ",e("b",{children:s.models_new})," new model",s.models_new===1?"":"s"," this year; one of them could be next."]})]})},{key:"rank",tone:"red",body:e(w,{children:[e("div",{class:"w-kicker",children:["Among ",f(s.authors_ranked)," ",b(s)?"dataset publishers":"publishers"," on the Hub"]}),e("div",{class:"w-big xl",children:["#",e(D,{to:s.rank,run:n(r("rank"))})]}),e("p",{class:"w-sub",children:I(s)?s.rank<=1e3?`A ${I(s)} ${b(s)?"dataset publisher":"publisher"} by downloads this year.`:`That's the ${I(s)} by downloads.`:"by downloads this year."}),e("div",{class:"w-chips",children:[e("span",{children:["+",f(s.likes_gained)," likes"]}),e("span",{children:[f(s.models_new)," new ",S(s,s.models_new)]}),e("span",{children:[f(s.models_total)," ",S(s,s.models_total)," in total"]})]})]})}]}async function ie(s){await Promise.all(["600 80px 'Fredoka'","500 20px 'IBM Plex Mono'","400 20px 'Source Sans 3'"].map(u=>document.fonts.load(u)));const l=1080,n=1350,i=document.createElement("canvas");i.width=l,i.height=n;const t=i.getContext("2d"),r="#1B1B1F",d="#ECE9E2",y="#FBFAF5",m="#FFD21E",_=(u,v,F,M,T)=>{t.fillStyle=r,t.beginPath(),t.roundRect(u+8,v+8,F,M,26),t.fill(),t.fillStyle=T,t.beginPath(),t.roundRect(u,v,F,M,26),t.fill(),t.lineWidth=4,t.strokeStyle=r,t.stroke()},o=(u,v,F,M,T=r,P)=>{if(t.font=M,t.fillStyle=T,P&&t.measureText(u).width>P){for(;u.length>3&&t.measureText(u+"…").width>P;)u=u.slice(0,-1);u+="…"}t.fillText(u,v,F)};t.fillStyle=d,t.fillRect(0,0,l,n),t.fillStyle=r,t.beginPath(),t.roundRect(68,68,76,76,20),t.fill(),t.fillStyle=m,t.beginPath(),t.roundRect(62,62,72,72,18),t.fill(),t.lineWidth=6,t.strokeStyle=r,t.stroke(),t.beginPath(),t.lineWidth=6,t.lineJoin="round",t.lineCap="round",t.moveTo(74,100),t.lineTo(87,100),t.lineTo(94,81),t.lineTo(106,117),t.lineTo(113,100),t.lineTo(124,100),t.stroke(),o("Model Pulse Wrapped",156,116,"600 44px 'Fredoka'"),o(b(s)?`datasets · ${H(s)}`:H(s),62,196,"500 26px 'IBM Plex Mono'","#6E6C66"),t.font="600 92px 'Fredoka'";const x=s.author.length>20?s.author.slice(0,19)+"…":s.author,a=Math.min(l-124,t.measureText(x).width+44);t.fillStyle=m,t.beginPath(),t.roundRect(54,222,a,120,18),t.fill(),o(x,76,314,"600 92px 'Fredoka'",r,l-170),_(62,386,l-124,250,"#3B6FF5"),o(b(s)?"dataset downloads in 12 months":"downloads in 12 months",100,446,"500 28px 'IBM Plex Mono'","#fff"),o(f(s.downloads),96,572,"600 118px 'Fredoka'","#fff",l-200);const p=[[`#1 ${S(s,1)}`,s.top_model?A(s.top_model.id):"–",s.top_model?`${k(s.top_model.downloads)} downloads`:""],["biggest week",s.best_week?k(s.best_week.downloads):"–",s.best_week?`week of ${Y(s.best_week.week_of,{month:"short",day:"numeric"})}`:""],["publisher rank",`#${f(s.rank)}`,I(s)??`of ${k(s.authors_ranked)}`],s.ripple.models>0?[b(s)?"trained on yours":"built on yours",f(s.ripple.models),"models by others"]:["published",f(s.models_new),`new ${S(s,s.models_new)} this year`]],g=(l-124-32)/2,C=230;p.forEach(([u,v,F],M)=>{const T=62+M%2*(g+32),P=676+Math.floor(M/2)*(C+32);_(T,P,g,C,M===0?m:y),o(u,T+30,P+54,"500 24px 'IBM Plex Mono'","#6E6C66"),o(v,T+28,P+136,`600 ${v.length>14?46:70}px 'Fredoka'`,r,g-56),o(F,T+30,P+190,"400 26px 'Source Sans 3'","#3D3D45",g-60)});const E=ee(s).map(u=>u.downloads),R=Math.max(...E,1),B=62,c=1196,h=l-124,W=64,q=6,G=(h-q*(E.length-1))/Math.max(1,E.length);return E.forEach((u,v)=>{const F=Math.max(4,u/R*W),M=B+v*(G+q);t.fillStyle=v===E.indexOf(R)?m:y,t.beginPath(),t.roundRect(M,c+W-F,G,F,4),t.fill(),t.lineWidth=3,t.strokeStyle=r,t.stroke()}),o("modelpulse.ifsp.dev",62,n-40,"500 24px 'IBM Plex Mono'","#6E6C66"),new Promise(u=>i.toBlob(v=>u(v),"image/png"))}function Z({initial:s}){const[l,n]=$(s??""),[i,t]=$([]),[r,d]=$(-1),[y,m]=$(!1);U(()=>{const a=l.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];if(a.length<2){t([]);return}let p=!0;const g=setTimeout(()=>K.searchAuthors(a).then(C=>{p&&(t(C),d(-1))}).catch(()=>{}),120);return()=>{p=!1,clearTimeout(g)}},[l]);const[_,o]=$(null);U(()=>{K.leaderboards().then(o).catch(()=>{})},[]);const x=a=>{const p=a.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];p&&L({view:"wrapped",author:p})};return e("div",{class:"wrap w-entry",children:[e("h1",{children:[e(z,{size:72}),"Model Pulse ",e("span",{class:"hl",children:"Wrapped"})]}),e("p",{class:"lede",children:"Your last 12 months on the Hugging Face Hub, for your models or your datasets: total downloads, your #1, your biggest week, the models built on yours (or trained on your data), and where you rank."}),e("form",{class:"w-form",onSubmit:a=>{a.preventDefault(),x(r>=0&&i[r]?i[r].author:l)},children:[e("div",{class:"search big",children:[e("input",{value:l,onInput:a=>{n(a.target.value),m(!0)},placeholder:"Username or org, e.g. Qwen","aria-label":"Username or organization",autoFocus:!0,spellcheck:!1,autocomplete:"off",role:"combobox","aria-expanded":y&&i.length>0,"aria-controls":"wrapped-results",onFocus:()=>m(!0),onBlur:()=>setTimeout(()=>m(!1),150),onKeyDown:a=>{a.key==="ArrowDown"?(a.preventDefault(),d(p=>Math.min(p+1,i.length-1))):a.key==="ArrowUp"?(a.preventDefault(),d(p=>Math.max(p-1,-1))):a.key==="Escape"&&m(!1)}}),y&&i.length>0&&e("ul",{class:"results",id:"wrapped-results",role:"listbox",children:i.map((a,p)=>e("li",{role:"option","aria-selected":p===r,onMouseEnter:()=>d(p),onMouseDown:g=>{g.preventDefault(),x(a.author)},children:[e("span",{class:"rid",children:a.author}),e("span",{class:"rmeta",children:[[a.models?`${f(a.models)} model${a.models===1?"":"s"}`:"",a.datasets?`${f(a.datasets)} dataset${a.datasets===1?"":"s"}`:""].filter(Boolean).join(" · ")," · ",k(a.dl30??0),"/mo"]})]},a.author))})]}),e("button",{class:"btn primary",type:"submit",children:"Get my Wrapped"})]}),_&&e("div",{class:"examples",children:[e("span",{class:"muted",children:"or try"}),_.authors_7d.slice(0,10).map(a=>e("a",{class:"chip",href:j({view:"wrapped",author:a.author}),onClick:p=>{p.preventDefault(),x(a.author)},children:a.author},a.author))]})]})}function de({author:s,kind:l}){var B;const[n,i]=$(null),[t,r]=$(null),[d,y]=$(0),[m,_]=$(!1),o=se(null);U(()=>{if(document.title=s?`${s}'s ${l==="datasets"?"datasets, the ":""}last 12 months on Hugging Face · Model Pulse Wrapped`:"Model Pulse Wrapped: your last 12 months on Hugging Face",i(null),r(null),y(0),!s)return;let c=!0;return fetch(`${te}/api/wrapped/${encodeURIComponent(s)}${l?`?kind=${l}`:""}`).then(async h=>{const W=await h.json();if(!h.ok)throw new Error(W.detail||"Something went wrong");return W}).then(h=>{c&&i(h)}).catch(h=>{c&&r(h.message)}),()=>{c=!1}},[s,l]);const x=n?Q(n,d).length+1:0,a=()=>y(c=>Math.min(x-1,c+1)),p=()=>y(c=>Math.max(0,c-1));if(U(()=>{if(!n)return;const c=h=>{(h.key==="ArrowRight"||h.key===" ")&&(h.preventDefault(),a()),h.key==="ArrowLeft"&&p()};return addEventListener("keydown",c),()=>removeEventListener("keydown",c)},[n,x]),!s)return e(Z,{});if(t)return e("div",{class:"wrap w-entry",children:[e("h1",{class:"w-err",children:["No Wrapped for ",s," yet"]}),e("p",{class:"lede",children:t}),e(Z,{initial:""})]});if(!n)return e("div",{class:"wrap w-loading",children:[e(z,{size:64}),e("p",{children:["Crunching 12 months of ",l==="datasets"?"dataset ":"","downloads for ",e("b",{children:s}),"…"]})]});const g=Q(n,d),C=ne({view:"wrapped",author:n.author,kind:b(n)?"datasets":void 0}),E=`${b(n)?"My datasets' last 12 months":"My last 12 months"} on the Hugging Face Hub: ${k(n.downloads)} downloads${I(n)&&(n.rank<=1e3||(n.top_pct??100)<=10)?`, ${I(n)} of publishers`:""}. Get your Model Pulse Wrapped:`,R=d===g.length;return e("div",{class:"wrap w-page",children:e("div",{class:"w-stage",ref:o,children:[(((B=n.kinds)==null?void 0:B.length)??0)>1&&e("div",{class:"w-kinds",children:e("div",{class:"seg",role:"group","aria-label":`${n.author}'s Wrapped for`,children:n.kinds.map(c=>e("button",{"aria-pressed":n.kind===c,onClick:()=>{n.kind!==c&&L({view:"wrapped",author:n.author,kind:c==="datasets"?"datasets":void 0})},children:c==="datasets"?"Datasets":"Models"},c))})}),e("div",{class:"w-progress","aria-hidden":"true",children:Array.from({length:x},(c,h)=>e("span",{class:h<d?"done":h===d?"now":""},h))}),R?e("div",{class:"w-card tone-paper w-summary",children:[e("div",{class:"w-kicker",children:H(n)}),e("h2",{class:"w-title sm",children:e("span",{class:"w-name",children:n.author})}),e("div",{class:"w-grid",children:[e("div",{class:"t blue",children:[e("span",{children:"downloads"}),e("b",{children:k(n.downloads)})]}),e("div",{class:"t",children:[e("span",{children:["#1 ",S(n,1)]}),e("b",{class:"s",children:n.top_model?A(n.top_model.id):"–"})]}),e("div",{class:"t",children:[e("span",{children:"biggest week"}),e("b",{children:n.best_week?k(n.best_week.downloads):"–"})]}),e("div",{class:"t yellow",children:[e("span",{children:b(n)?"dataset publisher rank":"publisher rank"}),e("b",{children:["#",f(n.rank)]})]}),n.ripple.models>0?e("div",{class:"t",children:[e("span",{children:b(n)?"trained on yours":"built on yours"}),e("b",{children:f(n.ripple.models)})]}):e("div",{class:"t",children:[e("span",{children:["new ",S(n)]}),e("b",{children:f(n.models_new)})]}),e("div",{class:"t",children:[e("span",{children:"likes gained"}),e("b",{children:["+",k(n.likes_gained)]})]})]}),e("div",{class:"w-actions",children:[e("button",{class:"btn primary",disabled:m,onClick:async()=>{_(!0);try{const c=await ie(n),h=document.createElement("a");h.href=URL.createObjectURL(c),h.download=`${n.author}${b(n)?"-datasets":""}-model-pulse-wrapped.png`,h.click(),setTimeout(()=>URL.revokeObjectURL(h.href),2e3)}finally{_(!1)}},children:m?"Drawing…":"Download image"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(E)}&url=${encodeURIComponent(C)}`,children:"Post on X"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(C)}`,children:"LinkedIn"}),e("button",{class:"btn",onClick:()=>{var c;return(c=navigator.clipboard)==null?void 0:c.writeText(C)},children:"Copy link"})]}),e("div",{class:"w-more",children:[e("a",{href:j({author:n.author}),onClick:c=>{c.preventDefault(),L({author:n.author})},children:["See ",n.author,"'s ",S(n)]}),e("a",{href:j({view:"wrapped"}),onClick:c=>{c.preventDefault(),L({view:"wrapped"})},children:"Try another name"})]}),e("div",{class:"w-like",children:e(le,{})})]},"summary"):e("div",{class:`w-card tone-${g[d].tone}`,"aria-live":"polite",children:[g[d].body,e("button",{class:"w-tap left","aria-label":"Previous card",onClick:p}),e("button",{class:"w-tap right","aria-label":"Next card",onClick:a})]},g[d].key),e("div",{class:"w-nav",children:[e("button",{class:"btn",onClick:p,disabled:d===0,children:"Back"}),e("span",{class:"w-mono",children:[d+1," / ",x]}),e("button",{class:"btn primary",onClick:a,disabled:R,children:d===g.length-1?"Summary":"Next"})]})]})})}export{de as Wrapped};
|
|
|
|
| 1 |
+
import{d as $,A as se,h as U,i as te,u as e,c as z,s as ne,b as k,n as L,f,a as j,L as le,S as w,j as Y,k as K}from"./index-DkdXqYYM.js";const b=s=>s.kind==="datasets",S=(s,l=2)=>(b(s)?"dataset":"model")+(l===1?"":"s"),oe=["zero","one","two","three","four","five","six","seven","eight","nine"],N=s=>s.replace(/-/g," "),ae=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function D({to:s,run:l,format:n=f}){const[i,t]=$(0);return U(()=>{if(!l){t(0);return}if(ae()){t(s);return}let r=0;const d=performance.now(),y=1300,m=_=>{const o=Math.min(1,(_-d)/y);t(s*(1-Math.pow(1-o,3))),o<1&&(r=requestAnimationFrame(m))};return r=requestAnimationFrame(m),()=>cancelAnimationFrame(r)},[s,l]),e(w,{children:n(Math.round(i))})}const V=s=>{if(s.every_seconds>=1){const l=s.every_seconds;return l<60?`one download every ${l.toFixed(l<10?1:0)} seconds`:l<3600?`one download every ${Math.round(l/60)} minutes`:`one download every ${Math.round(l/3600)} hours`}return s.per_minute>=1e3?`${k(s.per_minute)} downloads every minute`:`${Math.round(s.per_minute)} downloads every minute`},A=s=>s.split("/").slice(1).join("/")||s,X=["#ffd21e","#fbfaf5","#ff8a1f","#3fd08a","#7fb1ff"],re=s=>{const l=s.tasks;if(!l||!l.top.length||!l.total_30d)return null;const n=l.top.reduce((t,r)=>t+r.downloads_30d,0);return n/l.total_30d<.3?null:{rows:l.top.map((t,r)=>({...t,share:t.downloads_30d/n,color:X[r%X.length]})),untagged:1-n/l.total_30d}},O=s=>s.downloads_all&&s.downloads_all>s.downloads?s.downloads_all:null,I=s=>s.rank<=10?"top 10":s.rank<=100?"top 100":s.rank<=1e3?"top 1,000":s.top_pct==null||s.top_pct>50?null:`top ${s.top_pct<1?s.top_pct.toFixed(1):Math.ceil(s.top_pct)}%`,ee=s=>{const l=new Date(s.period.to.slice(0,7)+"-01T00:00:00Z"),n=new Map(s.months.map(i=>[i.month.slice(0,7),i.downloads]));return Array.from({length:12},(i,t)=>{const d=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth()-12+t,1)).toISOString().slice(0,7);return{month:d,downloads:n.get(d)??0}})},H=s=>`${Y(s.period.from,{month:"short",year:"numeric"})} – ${Y(s.period.to,{month:"short",year:"numeric"})}`;function J({values:s,highlight:l,light:n}){const i=Math.max(...s,1);return e("div",{class:`w-bars${n?" light":""}`,"aria-hidden":"true",children:s.map((t,r)=>e("span",{class:r===l?"hi":"",style:{height:`${Math.max(3,t/i*100)}%`}},r))})}function Q(s,l){const n=o=>l===o,i=b(s)?re(s):null,t=["intro","downloads","top",...i?["mix"]:[],"week","ripple","rank"],r=o=>t.indexOf(o),d=t.length,y=s.weeks.map(o=>o.downloads),m=s.best_week?s.weeks.findIndex(o=>o.week_of===s.best_week.week_of):-1;return[{key:"intro",tone:"yellow",body:e(w,{children:[e("div",{class:"w-kicker",children:["Model Pulse Wrapped",b(s)&&e("span",{class:"w-edition",children:"datasets"})]}),e("div",{class:"w-logo",children:e(z,{size:88})}),e("h2",{class:"w-title",children:[e("span",{class:"w-name",children:s.author}),e("br",{}),"on the Hub"]}),e("p",{class:"w-sub",children:[b(s)?"Your datasets' last 12 months":"Your last 12 months",", in ",oe[d]??d," cards."]}),e("p",{class:"w-mono",children:H(s)})]})},{key:"downloads",tone:"blue",body:e(w,{children:[e("div",{class:"w-kicker",children:["Your ",S(s)," were downloaded"]}),O(s)?e(w,{children:[e("div",{class:"w-big",children:e(D,{to:O(s),run:n(1)})}),e("p",{class:"w-sub",children:["times in total. ",k(s.downloads)," of them in the last 12 months: ",V(s),"."]})]}):e(w,{children:[e("div",{class:"w-big",children:e(D,{to:s.downloads,run:n(1)})}),e("p",{class:"w-sub",children:["times. That's ",V(s),"."]})]}),e(J,{values:ee(s).map(o=>o.downloads),light:!0}),e("p",{class:"w-mono",children:O(s)?"last 12 months, by month":"downloads by month"})]})},{key:"top",tone:"paper",body:s.top_model?e(w,{children:[e("div",{class:"w-kicker",children:["Your #1 ",S(s,1)," this year"]}),e("h2",{class:"w-model",children:e("span",{children:A(s.top_model.id)})}),e("div",{class:"w-big sm",children:[e(D,{to:s.top_model.downloads,run:n(2),format:k})," ",e("small",{children:"downloads"})]}),e("p",{class:"w-sub",children:[Math.round(s.top_model.share*100),"% of everything you served",s.top_model.task?`, as ${N(s.top_model.task)}`:"","."]}),s.top_models.length>1&&e("ol",{class:"w-list",start:2,children:s.top_models.slice(1,5).map(o=>e("li",{children:[e("span",{children:A(o.id)}),e("b",{children:k(o.downloads)})]},o.id))})]}):e("p",{class:"w-sub",children:["No single ",S(s,1)," stood out this year."]})},...i?[{key:"mix",tone:"purple",body:e(w,{children:[e("div",{class:"w-kicker",children:"What your data is for"}),e("h2",{class:"w-title sm",children:i.rows[0].share>=.5?e(w,{children:["Mostly ",e("span",{class:"w-hl",children:N(i.rows[0].task)})]}):e(w,{children:["A bit of ",e("span",{class:"w-hl",children:"everything"})]})}),e("div",{class:`w-mix${n(3)?" run":""}`,"aria-hidden":"true",children:i.rows.map(o=>e("span",{style:{flexGrow:o.share,background:o.color}},o.task))}),e("ul",{class:"w-legend",children:i.rows.map(o=>e("li",{children:[e("i",{style:{background:o.color}}),e("span",{children:N(o.task)}),e("b",{children:[Math.round(o.share*100)||"<1","%"]}),e("small",{children:[f(o.datasets)," ",o.datasets===1?"dataset":"datasets"]})]},o.task))}),e("p",{class:"w-mono",children:["share of your downloads in the last 30 days, by task category",i.untagged>=.05?`. ${Math.round(i.untagged*100)}% come from datasets with no category`:""]})]})}]:[],{key:"week",tone:"orange",body:s.best_week?e(w,{children:[e("div",{class:"w-kicker",children:"Your biggest week"}),e("h2",{class:"w-title sm",children:["Week of ",Y(s.best_week.week_of,{month:"long",day:"numeric",year:"numeric"})]}),e("div",{class:"w-big",children:e(D,{to:s.best_week.downloads,run:n(r("week"))})}),e("p",{class:"w-sub",children:"downloads in seven days."}),e(J,{values:y,highlight:m})]}):e("p",{class:"w-sub",children:"Not enough weeks of data yet."})},b(s)?{key:"ripple",tone:"green",body:s.ripple.models>0||(s.ripple.spaces??0)>0?e(w,{children:[e("div",{class:"w-kicker",children:"Trained on your data"}),s.ripple.models>0?e(w,{children:[e("div",{class:"w-big",children:e(D,{to:s.ripple.models,run:n(r("ripple"))})}),e("p",{class:"w-sub",children:["model",s.ripple.models===1?"":"s"," by other people list",s.ripple.models===1?"s":""," your datasets as training data.",s.ripple.downloads_30d>0&&e(w,{children:[" ",s.ripple.models===1?"It was":"Together they were"," downloaded ",e("b",{children:k(s.ripple.downloads_30d)})," times last month."]})]}),s.ripple.top&&e("p",{class:"w-mono",children:[s.ripple.models>1?"the biggest: ":"",s.ripple.top.id,", trained on ",A(s.ripple.top.dataset??"")]}),(s.ripple.spaces??0)>0&&e("div",{class:"w-chips",children:e("span",{children:[f(s.ripple.spaces)," Space",s.ripple.spaces===1?"":"s"," use",s.ripple.spaces===1?"s":""," them too"]})})]}):e(w,{children:[e("div",{class:"w-big",children:e(D,{to:s.ripple.spaces,run:n(r("ripple"))})}),e("p",{class:"w-sub",children:["Space",s.ripple.spaces===1?"":"s"," by other people use",s.ripple.spaces===1?"s":""," your datasets. No model lists them as training data yet."]})]})]}):e(w,{children:[e("div",{class:"w-kicker",children:"Trained on your data"}),e("h2",{class:"w-title sm",children:"No models list it yet."}),e("p",{class:"w-sub",children:["When someone names one of your datasets in a model card's ",e("code",{children:"datasets:"})," field, that model shows up here. You published ",e("b",{children:s.models_new})," new dataset",s.models_new===1?"":"s"," this year; one of them could be next."]})]})}:{key:"ripple",tone:"green",body:s.ripple.models>0?e(w,{children:[e("div",{class:"w-kicker",children:"Your ripple effect"}),e("div",{class:"w-big",children:e(D,{to:s.ripple.models,run:n(r("ripple"))})}),e("p",{class:"w-sub",children:["models by other people build on yours. Together they were downloaded ",e("b",{children:k(s.ripple.downloads_30d)})," times last month."]}),s.ripple.top&&e("p",{class:"w-mono",children:["the biggest: ",s.ripple.top.id," (",s.ripple.top.relation,")"]})]}):e(w,{children:[e("div",{class:"w-kicker",children:"Your ripple effect"}),e("h2",{class:"w-title sm",children:"No derivatives yet."}),e("p",{class:"w-sub",children:["When someone quantizes or fine-tunes one of your models, it shows up here. You published ",e("b",{children:s.models_new})," new model",s.models_new===1?"":"s"," this year; one of them could be next."]})]})},{key:"rank",tone:"red",body:e(w,{children:[e("div",{class:"w-kicker",children:["Among ",f(s.authors_ranked)," ",b(s)?"dataset publishers":"publishers"," on the Hub"]}),e("div",{class:"w-big xl",children:["#",e(D,{to:s.rank,run:n(r("rank"))})]}),e("p",{class:"w-sub",children:I(s)?s.rank<=1e3?`A ${I(s)} ${b(s)?"dataset publisher":"publisher"} by downloads this year.`:`That's the ${I(s)} by downloads.`:"by downloads this year."}),e("div",{class:"w-chips",children:[e("span",{children:["+",f(s.likes_gained)," likes"]}),e("span",{children:[f(s.models_new)," new ",S(s,s.models_new)]}),e("span",{children:[f(s.models_total)," ",S(s,s.models_total)," in total"]})]})]})}]}async function ie(s){await Promise.all(["600 80px 'Fredoka'","500 20px 'IBM Plex Mono'","400 20px 'Source Sans 3'"].map(u=>document.fonts.load(u)));const l=1080,n=1350,i=document.createElement("canvas");i.width=l,i.height=n;const t=i.getContext("2d"),r="#1B1B1F",d="#ECE9E2",y="#FBFAF5",m="#FFD21E",_=(u,v,F,M,T)=>{t.fillStyle=r,t.beginPath(),t.roundRect(u+8,v+8,F,M,26),t.fill(),t.fillStyle=T,t.beginPath(),t.roundRect(u,v,F,M,26),t.fill(),t.lineWidth=4,t.strokeStyle=r,t.stroke()},o=(u,v,F,M,T=r,P)=>{if(t.font=M,t.fillStyle=T,P&&t.measureText(u).width>P){for(;u.length>3&&t.measureText(u+"…").width>P;)u=u.slice(0,-1);u+="…"}t.fillText(u,v,F)};t.fillStyle=d,t.fillRect(0,0,l,n),t.fillStyle=r,t.beginPath(),t.roundRect(68,68,76,76,20),t.fill(),t.fillStyle=m,t.beginPath(),t.roundRect(62,62,72,72,18),t.fill(),t.lineWidth=6,t.strokeStyle=r,t.stroke(),t.beginPath(),t.lineWidth=6,t.lineJoin="round",t.lineCap="round",t.moveTo(74,100),t.lineTo(87,100),t.lineTo(94,81),t.lineTo(106,117),t.lineTo(113,100),t.lineTo(124,100),t.stroke(),o("Model Pulse Wrapped",156,116,"600 44px 'Fredoka'"),o(b(s)?`datasets · ${H(s)}`:H(s),62,196,"500 26px 'IBM Plex Mono'","#6E6C66"),t.font="600 92px 'Fredoka'";const x=s.author.length>20?s.author.slice(0,19)+"…":s.author,a=Math.min(l-124,t.measureText(x).width+44);t.fillStyle=m,t.beginPath(),t.roundRect(54,222,a,120,18),t.fill(),o(x,76,314,"600 92px 'Fredoka'",r,l-170),_(62,386,l-124,250,"#3B6FF5"),o(b(s)?"dataset downloads in 12 months":"downloads in 12 months",100,446,"500 28px 'IBM Plex Mono'","#fff"),o(f(s.downloads),96,572,"600 118px 'Fredoka'","#fff",l-200);const p=[[`#1 ${S(s,1)}`,s.top_model?A(s.top_model.id):"–",s.top_model?`${k(s.top_model.downloads)} downloads`:""],["biggest week",s.best_week?k(s.best_week.downloads):"–",s.best_week?`week of ${Y(s.best_week.week_of,{month:"short",day:"numeric"})}`:""],["publisher rank",`#${f(s.rank)}`,I(s)??`of ${k(s.authors_ranked)}`],s.ripple.models>0?[b(s)?"trained on yours":"built on yours",f(s.ripple.models),"models by others"]:["published",f(s.models_new),`new ${S(s,s.models_new)} this year`]],g=(l-124-32)/2,C=230;p.forEach(([u,v,F],M)=>{const T=62+M%2*(g+32),P=676+Math.floor(M/2)*(C+32);_(T,P,g,C,M===0?m:y),o(u,T+30,P+54,"500 24px 'IBM Plex Mono'","#6E6C66"),o(v,T+28,P+136,`600 ${v.length>14?46:70}px 'Fredoka'`,r,g-56),o(F,T+30,P+190,"400 26px 'Source Sans 3'","#3D3D45",g-60)});const E=ee(s).map(u=>u.downloads),R=Math.max(...E,1),B=62,c=1196,h=l-124,W=64,q=6,G=(h-q*(E.length-1))/Math.max(1,E.length);return E.forEach((u,v)=>{const F=Math.max(4,u/R*W),M=B+v*(G+q);t.fillStyle=v===E.indexOf(R)?m:y,t.beginPath(),t.roundRect(M,c+W-F,G,F,4),t.fill(),t.lineWidth=3,t.strokeStyle=r,t.stroke()}),o("modelpulse.ifsp.dev",62,n-40,"500 24px 'IBM Plex Mono'","#6E6C66"),new Promise(u=>i.toBlob(v=>u(v),"image/png"))}function Z({initial:s}){const[l,n]=$(s??""),[i,t]=$([]),[r,d]=$(-1),[y,m]=$(!1);U(()=>{const a=l.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];if(a.length<2){t([]);return}let p=!0;const g=setTimeout(()=>K.searchAuthors(a).then(C=>{p&&(t(C),d(-1))}).catch(()=>{}),120);return()=>{p=!1,clearTimeout(g)}},[l]);const[_,o]=$(null);U(()=>{K.leaderboards().then(o).catch(()=>{})},[]);const x=a=>{const p=a.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];p&&L({view:"wrapped",author:p})};return e("div",{class:"wrap w-entry",children:[e("h1",{children:[e(z,{size:72}),"Model Pulse ",e("span",{class:"hl",children:"Wrapped"})]}),e("p",{class:"lede",children:"Your last 12 months on the Hugging Face Hub, for your models or your datasets: total downloads, your #1, your biggest week, the models built on yours (or trained on your data), and where you rank."}),e("form",{class:"w-form",onSubmit:a=>{a.preventDefault(),x(r>=0&&i[r]?i[r].author:l)},children:[e("div",{class:"search big",children:[e("input",{value:l,onInput:a=>{n(a.target.value),m(!0)},placeholder:"Username or org, e.g. Qwen","aria-label":"Username or organization",autoFocus:!0,spellcheck:!1,autocomplete:"off",role:"combobox","aria-expanded":y&&i.length>0,"aria-controls":"wrapped-results",onFocus:()=>m(!0),onBlur:()=>setTimeout(()=>m(!1),150),onKeyDown:a=>{a.key==="ArrowDown"?(a.preventDefault(),d(p=>Math.min(p+1,i.length-1))):a.key==="ArrowUp"?(a.preventDefault(),d(p=>Math.max(p-1,-1))):a.key==="Escape"&&m(!1)}}),y&&i.length>0&&e("ul",{class:"results",id:"wrapped-results",role:"listbox",children:i.map((a,p)=>e("li",{role:"option","aria-selected":p===r,onMouseEnter:()=>d(p),onMouseDown:g=>{g.preventDefault(),x(a.author)},children:[e("span",{class:"rid",children:a.author}),e("span",{class:"rmeta",children:[[a.models?`${f(a.models)} model${a.models===1?"":"s"}`:"",a.datasets?`${f(a.datasets)} dataset${a.datasets===1?"":"s"}`:""].filter(Boolean).join(" · ")," · ",k(a.dl30??0),"/mo"]})]},a.author))})]}),e("button",{class:"btn primary",type:"submit",children:"Get my Wrapped"})]}),_&&e("div",{class:"examples",children:[e("span",{class:"muted",children:"or try"}),_.authors_7d.slice(0,10).map(a=>e("a",{class:"chip",href:j({view:"wrapped",author:a.author}),onClick:p=>{p.preventDefault(),x(a.author)},children:a.author},a.author))]})]})}function de({author:s,kind:l}){var B;const[n,i]=$(null),[t,r]=$(null),[d,y]=$(0),[m,_]=$(!1),o=se(null);U(()=>{if(document.title=s?`${s}'s ${l==="datasets"?"datasets, the ":""}last 12 months on Hugging Face · Model Pulse Wrapped`:"Model Pulse Wrapped: your last 12 months on Hugging Face",i(null),r(null),y(0),!s)return;let c=!0;return fetch(`${te}/api/wrapped/${encodeURIComponent(s)}${l?`?kind=${l}`:""}`).then(async h=>{const W=await h.json();if(!h.ok)throw new Error(W.detail||"Something went wrong");return W}).then(h=>{c&&i(h)}).catch(h=>{c&&r(h.message)}),()=>{c=!1}},[s,l]);const x=n?Q(n,d).length+1:0,a=()=>y(c=>Math.min(x-1,c+1)),p=()=>y(c=>Math.max(0,c-1));if(U(()=>{if(!n)return;const c=h=>{(h.key==="ArrowRight"||h.key===" ")&&(h.preventDefault(),a()),h.key==="ArrowLeft"&&p()};return addEventListener("keydown",c),()=>removeEventListener("keydown",c)},[n,x]),!s)return e(Z,{});if(t)return e("div",{class:"wrap w-entry",children:[e("h1",{class:"w-err",children:["No Wrapped for ",s," yet"]}),e("p",{class:"lede",children:t}),e(Z,{initial:""})]});if(!n)return e("div",{class:"wrap w-loading",children:[e(z,{size:64}),e("p",{children:["Crunching 12 months of ",l==="datasets"?"dataset ":"","downloads for ",e("b",{children:s}),"…"]})]});const g=Q(n,d),C=ne({view:"wrapped",author:n.author,kind:b(n)?"datasets":void 0}),E=`${b(n)?"My datasets' last 12 months":"My last 12 months"} on the Hugging Face Hub: ${k(n.downloads)} downloads${I(n)&&(n.rank<=1e3||(n.top_pct??100)<=10)?`, ${I(n)} of publishers`:""}. Get your Model Pulse Wrapped:`,R=d===g.length;return e("div",{class:"wrap w-page",children:e("div",{class:"w-stage",ref:o,children:[(((B=n.kinds)==null?void 0:B.length)??0)>1&&e("div",{class:"w-kinds",children:e("div",{class:"seg",role:"group","aria-label":`${n.author}'s Wrapped for`,children:n.kinds.map(c=>e("button",{"aria-pressed":n.kind===c,onClick:()=>{n.kind!==c&&L({view:"wrapped",author:n.author,kind:c==="datasets"?"datasets":void 0})},children:c==="datasets"?"Datasets":"Models"},c))})}),e("div",{class:"w-progress","aria-hidden":"true",children:Array.from({length:x},(c,h)=>e("span",{class:h<d?"done":h===d?"now":""},h))}),R?e("div",{class:"w-card tone-paper w-summary",children:[e("div",{class:"w-kicker",children:H(n)}),e("h2",{class:"w-title sm",children:e("span",{class:"w-name",children:n.author})}),e("div",{class:"w-grid",children:[e("div",{class:"t blue",children:[e("span",{children:"downloads"}),e("b",{children:k(n.downloads)})]}),e("div",{class:"t",children:[e("span",{children:["#1 ",S(n,1)]}),e("b",{class:"s",children:n.top_model?A(n.top_model.id):"–"})]}),e("div",{class:"t",children:[e("span",{children:"biggest week"}),e("b",{children:n.best_week?k(n.best_week.downloads):"–"})]}),e("div",{class:"t yellow",children:[e("span",{children:b(n)?"dataset publisher rank":"publisher rank"}),e("b",{children:["#",f(n.rank)]})]}),n.ripple.models>0?e("div",{class:"t",children:[e("span",{children:b(n)?"trained on yours":"built on yours"}),e("b",{children:f(n.ripple.models)})]}):e("div",{class:"t",children:[e("span",{children:["new ",S(n)]}),e("b",{children:f(n.models_new)})]}),e("div",{class:"t",children:[e("span",{children:"likes gained"}),e("b",{children:["+",k(n.likes_gained)]})]})]}),e("div",{class:"w-actions",children:[e("button",{class:"btn primary",disabled:m,onClick:async()=>{_(!0);try{const c=await ie(n),h=document.createElement("a");h.href=URL.createObjectURL(c),h.download=`${n.author}${b(n)?"-datasets":""}-model-pulse-wrapped.png`,h.click(),setTimeout(()=>URL.revokeObjectURL(h.href),2e3)}finally{_(!1)}},children:m?"Drawing…":"Download image"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(E)}&url=${encodeURIComponent(C)}`,children:"Post on X"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(C)}`,children:"LinkedIn"}),e("button",{class:"btn",onClick:()=>{var c;return(c=navigator.clipboard)==null?void 0:c.writeText(C)},children:"Copy link"})]}),e("div",{class:"w-more",children:[e("a",{href:j({author:n.author}),onClick:c=>{c.preventDefault(),L({author:n.author})},children:["See ",n.author,"'s ",S(n)]}),e("a",{href:j({view:"wrapped"}),onClick:c=>{c.preventDefault(),L({view:"wrapped"})},children:"Try another name"})]}),e("div",{class:"w-like",children:e(le,{})})]},"summary"):e("div",{class:`w-card tone-${g[d].tone}`,"aria-live":"polite",children:[g[d].body,e("button",{class:"w-tap left","aria-label":"Previous card",onClick:p}),e("button",{class:"w-tap right","aria-label":"Next card",onClick:a})]},g[d].key),e("div",{class:"w-nav",children:[e("button",{class:"btn",onClick:p,disabled:d===0,children:"Back"}),e("span",{class:"w-mono",children:[d+1," / ",x]}),e("button",{class:"btn primary",onClick:a,disabled:R,children:d===g.length-1?"Summary":"Next"})]})]})})}export{de as Wrapped};
|
assets/index-CvpbkKT6.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/index-DkdXqYYM.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
| 27 |
});
|
| 28 |
}
|
| 29 |
</script>
|
| 30 |
-
<script type="module" crossorigin src="/assets/index-
|
| 31 |
<link rel="stylesheet" crossorigin href="/assets/index-C4z3YX9g.css">
|
| 32 |
</head>
|
| 33 |
<body>
|
|
|
|
| 27 |
});
|
| 28 |
}
|
| 29 |
</script>
|
| 30 |
+
<script type="module" crossorigin src="/assets/index-DkdXqYYM.js"></script>
|
| 31 |
<link rel="stylesheet" crossorigin href="/assets/index-C4z3YX9g.css">
|
| 32 |
</head>
|
| 33 |
<body>
|