Spaces:
Running
Running
Update site
Browse files
assets/{Galaxy-C3f_Mb2S.js → Galaxy-RNB4yVZf.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as Y,h as ne,g as ke,T as ae,u as l,s as ve,f as _,n as Z,a as ee,S as ce,b as se,L as Me,c as Se,e as Te,A as te}from"./index-Dwt6XRc6.js";const G=[{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"}],ue=[1,2,0,3],H="#1b1b1f",re="#fbfaf5",de="#ffd21e",ie="#63615b",me=[0,330,590,800,960],V=Math.PI*2,he=["","1st","2nd","3rd","4th+"],ye=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,oe=e=>e.split("/").pop()??e,J=(e,r)=>e.nodes.rel[r]>=0?e.nodes.rel[r]:1;function ge(e,r){let h=Math.imul(e^2654435769,2246822507)^Math.imul(r+1,3266489909);return h^=h>>>13,h=Math.imul(h,668265263),h^=h>>>16,(h>>>0)/4294967296}function Ce(e){const{parent:r,dl30:h}=e.nodes,u=r.length,F=new Uint8Array(u),i=new Int32Array(u).fill(1),g=new Int32Array(u+1);for(let o=1;o<u;o++)F[o]=Math.min(4,F[r[o]]+1),g[r[o]+1]++;for(let o=0;o<u;o++)g[o+1]+=g[o];const p=g.slice(0,u),k=new Int32Array(Math.max(0,u-1));for(let o=1;o<u;o++)k[p[r[o]]++]=o;for(let o=u-1;o>0;o--)i[r[o]]+=i[o];const v=[0,0,0,0,0];for(let o=1;o<u;o++)v[F[o]]++;const S=o=>1+Math.pow(i[o]-1,.8),P=new Float32Array(u),C=new Float32Array(u),T=new Float32Array(u),y=new Float32Array(u),R=(o,M,b)=>{o.sort((U,K)=>S(K)-S(U)||(h[K]||0)-(h[U]||0));const B=[];o.forEach((U,K)=>K%2?B.unshift(U):B.push(U));const N=B.reduce((U,K)=>U+S(K),0)||1;let le=M;for(const U of B){const K=(b-M)*S(U)/N;P[U]=le+K/2,C[U]=K,le+=K}},W=Array.from(k.subarray(g[0],g[1])),w=[0,1,2,3].map(o=>W.filter(M=>J(e,M)===o)),$=ue.filter(o=>w[o].length),E=$.length>1?.05:0,Q=$.map(o=>Math.sqrt(w[o].reduce((M,b)=>M+S(b),0))),O=Q.reduce((o,M)=>o+M,0)||1,X=$.length>1?.12:1,q=Q.map(o=>Math.max(X,o/O)),j=q.reduce((o,M)=>o+M,0),d=V-E*$.length,x=[];let t=-Math.PI/2-q[0]/j*d/2;$.forEach((o,M)=>{const b=q[M]/j*d;x.push({rel:o,a0:t,a1:t+b,count:w[o].length}),R(w[o],t,t+b),t+=b+E});for(let o=1;o<u;o++)g[o+1]>g[o]&&R(Array.from(k.subarray(g[o],g[o+1])),P[o]-C[o]/2,P[o]+C[o]/2);let s=1;for(let o=1;o<u;o++)s=Math.max(s,h[o]||0);const c=new Float32Array(u);for(let o=1;o<u;o++)c[o]=(h[o]||0)>0?Math.min(24,1.6+22*Math.sqrt((h[o]||0)/s)):1.2;const a=v.map(o=>Math.max(14,Math.min(120,Math.sqrt(o)*1.3)));for(let o=1;o<u;o++){const M=F[o],b=c[o]>=5,B=me[M]+(b?0:(ge(o,1)-.5)*a[M]),N=b?P[o]:P[o]+(ge(o,2)-.5)*Math.min(C[o]*.9,.08);T[o]=Math.cos(N)*B,y[o]=Math.sin(N)*B}const n=Int32Array.from({length:u},(o,M)=>M).sort((o,M)=>(h[M]||0)-(h[o]||0)),f=[0,1,2,3].map(o=>Int32Array.from({length:u},(M,b)=>b).filter(M=>M>0&&J(e,M)===o)),m=n.filter(o=>o>0&&(h[o]||0)>0).slice(0,160),A=v.reduce((o,M,b)=>M?b:o,1),z=me.slice(1,A+1),D=z[z.length-1]+a[A]/2+120,L=24,I=new Map;for(let o=0;o<u;o++){const M=Math.floor(T[o]/L)*100003+Math.floor(y[o]/L),b=I.get(M);b?b.push(o):I.set(M,[o])}return{n:u,x:T,y,ang:P,size:c,depth:F,sub:i,start:g,kids:k,byRel:f,order:n,rings:z,sectors:x,gens:v,extent:D,cell:L,grid:I,links:m}}const pe=(e,r)=>Math.min(2.6,Math.max(1,Math.sqrt(e/r))),xe=e=>22+6*(e-1);function be(e,r,h,u,F,i,g){const{x:p,y:k,size:v}=i,S=d=>(d-u.cx)*u.k+r/2,P=d=>(d-u.cy)*u.k+h/2,C=S(0),T=P(0),y=pe(u.k,g.kFit),R=g.p>=1?1:1-(1-g.p)**3;e.globalAlpha=1,e.fillStyle=re,e.fillRect(0,0,r,h);for(const d of i.sectors)g.hidden[d.rel]||(e.beginPath(),e.moveTo(C,T),e.arc(C,T,(i.extent-60)*u.k,d.a0,d.a1),e.closePath(),e.fillStyle=G[d.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 d of i.rings)e.beginPath(),e.arc(C,T,d*u.k*R,0,V),e.stroke();e.setLineDash([]),e.strokeStyle=H,e.lineWidth=1,e.globalAlpha=.16*R,e.beginPath();for(const d of i.links){const x=F.nodes.parent[d];g.hidden[J(F,d)]||(e.moveTo(S(p[x]*R),P(k[x]*R)),e.lineTo(S(p[d]*R),P(k[d]*R)))}e.stroke(),e.globalAlpha=1;for(let d=0;d<4;d++){if(g.hidden[d])continue;e.fillStyle=G[d].color,e.globalAlpha=.5;const x=new Path2D;for(const t of i.byRel[d]){if(v[t]>=5)continue;const s=S(p[t]*R),c=P(k[t]*R),a=v[t]*y;s<-a||c<-a||s>r+a||c>h+a||(a<1.6?x.rect(s-a,c-a,a*2,a*2):(x.moveTo(s+a,c),x.arc(s,c,a,0,V)))}e.fill(x)}e.globalAlpha=1;for(let d=i.n-1;d>=0;d--){const x=i.order[d];if(x===0||v[x]<5||g.hidden[J(F,x)])continue;const t=S(p[x]*R),s=P(k[x]*R),c=v[x]*y;e.beginPath(),e.arc(t,s,c,0,V),e.fillStyle=G[J(F,x)].color,e.fill(),e.lineWidth=2,e.strokeStyle=H,e.stroke()}const W=xe(y);e.beginPath(),e.arc(C+4,T+4,W,0,V),e.fillStyle=H,e.fill(),e.beginPath(),e.arc(C,T,W,0,V),e.fillStyle=de,e.fill(),e.lineWidth=3,e.strokeStyle=H,e.stroke();for(const d of[g.sel,g.hover])d>0&&fe(e,r,h,u,F,i,g.kFit,d,d===g.sel);if(g.p<1)return;const w=[[C-W-6,T-W-6,W*2+12,W*2+12],[r-64,0,64,150]];for(const d of i.links){if(g.hidden[J(F,d)]||v[d]<5)continue;const x=v[d]*y;w.push([S(p[d])-x,P(k[d])-x,x*2,x*2])}e.textBaseline="middle",e.lineJoin="round";for(const d of i.sectors){if(g.hidden[d.rel])continue;const x=(d.a0+d.a1)/2,t=(i.extent-70)*u.k,s=C+Math.cos(x)*t,c=T+Math.sin(x)*t,a=G[d.rel].label,n=`${_(d.count)} direct`;e.font="600 13px 'IBM Plex Mono', ui-monospace, monospace";const f=e.measureText(`${a} ${n}`).width,m=Math.max(6,Math.min(r-f-6,s-f/2));c<10||c>h-10||(e.lineWidth=4,e.strokeStyle=re,e.strokeText(`${a} ${n}`,m,c),e.fillStyle=G[d.rel].color,e.fillText(a,m,c),e.fillStyle=H,e.fillText(n,m+e.measureText(`${a} `).width,c),w.push([m-2,c-10,f+4,20]))}e.font="500 11.5px 'IBM Plex Mono', ui-monospace, monospace",i.rings.forEach((d,x)=>{const t=`${he[x+1]} generation`,s=e.measureText(t).width,c=C-s/2,a=T+d*u.k+11;a<8||a>h-8||(e.lineWidth=4,e.strokeStyle=re,e.strokeText(t,c,a),e.fillStyle=ie,e.fillText(t,c,a),w.push([c-2,a-8,s+4,16]))}),e.font="600 15px 'Fredoka', system-ui, sans-serif";const $=oe(F.root.id),E=e.measureText($).width,Q=T+W+16;Q<h-8&&(e.lineWidth=5,e.strokeStyle=re,e.strokeText($,C-E/2,Q),e.fillStyle=H,e.fillText($,C-E/2,Q),w.push([C-E/2-2,Q-10,E+4,20]));const O=g.labels??Math.min(40,Math.round(14+10*Math.max(0,Math.log2(u.k/g.kFit)))),X=new Set;e.font="600 13px 'Source Sans 3', system-ui, sans-serif";let q=0;const j=(d,x=!1)=>{var z;const t=oe(F.nodes.id[d]);if(!x&&X.has(t))return;const s=S(p[d]),c=P(k[d]),a=v[d]*y,n=Math.cos(i.ang[d])>=-.1,f=e.measureText(t).width,m=n?s+a+5:s-a-5-f,A=c-9;m<4||A<4||m+f>r-4||A+18>h-4||!x&&w.some(D=>m<D[0]+D[2]&&m+f>D[0]&&A<D[1]+D[3]&&A+18>D[1])||(w.push([m-2,A,f+4,18]),(z=g.labelHits)==null||z.push([m-2,A,f+4,18,d]),X.add(t),e.lineWidth=4,e.strokeStyle=re,e.strokeText(t,m,c),e.fillStyle=H,e.fillText(t,m,c),q++)};g.sel>0&&j(g.sel,!0);for(let d=0;d<Math.min(i.n,800)&&q<O;d++){const x=i.order[d];x>0&&(F.nodes.dl30[x]||0)>0&&!g.hidden[J(F,x)]&&j(x)}}function fe(e,r,h,u,F,i,g,p,k){const v=T=>(i.x[T]-u.cx)*u.k+r/2,S=T=>(i.y[T]-u.cy)*u.k+h/2,P=pe(u.k,g);e.globalAlpha=.5,e.strokeStyle=G[J(F,p)].color,e.lineWidth=1.2,e.beginPath();for(let T=i.start[p];T<i.start[p+1]&&T<i.start[p]+400;T++){const y=i.kids[T];e.moveTo(v(p),S(p)),e.lineTo(v(y),S(y))}e.stroke(),e.globalAlpha=1,e.strokeStyle=H,e.lineWidth=2.5,e.beginPath();let C=p;for(e.moveTo(v(C),S(C));C>0;)C=F.nodes.parent[C],e.lineTo(v(C),S(C));e.stroke(),e.beginPath(),e.arc(v(p),S(p),Math.max(5,i.size[p]*P)+5,0,V),e.lineWidth=3,e.strokeStyle=k?H:ie,e.stroke(),k&&(e.beginPath(),e.arc(v(p),S(p),Math.max(5,i.size[p]*P)+9,0,V),e.lineWidth=2,e.strokeStyle=de,e.stroke())}const we=(e,r,h)=>({k:(Math.min(r,h)/2-8)/e.extent,cx:0,cy:0});function Fe({g:e,L:r,hidden:h,sel:u,hoverExt:F,onSel:i,flyTo:g}){const p=te(null),k=te(null),v=te({W:0,H:0,dpr:1,view:{k:1,cx:0,cy:0},kFit:1,p:ye()?1:0,hover:-1,raf:0,labels:[]}),S=te({hidden:h,sel:u,hoverExt:F});S.current={hidden:h,sel:u,hoverExt:F};const P=te(null),C=te(0),T=te(i);T.current=i;const[y,R]=Y(null),W=()=>S.current.hoverExt>0?S.current.hoverExt:v.current.hover,w=()=>{var a,n;const t=v.current,s=(a=k.current)==null?void 0:a.getContext("2d");if(!s||!t.W)return;s.setTransform(t.dpr,0,0,t.dpr,0,0),t.labels=[];const c=performance.now();if(be(s,t.W,t.H,t.view,e,r,{p:t.p,hidden:S.current.hidden,hover:-1,sel:S.current.sel,kFit:t.kFit,labelHits:t.labels}),t.p>=1){const f=((n=P.current)==null?void 0:n.img)??document.createElement("canvas");(f.width!==k.current.width||f.height!==k.current.height)&&(f.width=k.current.width,f.height=k.current.height);const m=f.getContext("2d");m.setTransform(1,0,0,1,0,0),m.drawImage(k.current,0,0),P.current={img:f,view:{...t.view},heavy:performance.now()-c>22}}W()>0&&fe(s,t.W,t.H,t.view,e,r,t.kFit,W(),!1)},$=()=>{var m;const t=v.current,s=(m=k.current)==null?void 0:m.getContext("2d"),c=P.current;if(!s||!c)return w();const a=t.view.k/c.view.k;s.setTransform(1,0,0,1,0,0),s.fillStyle=re,s.fillRect(0,0,k.current.width,k.current.height);const n=(t.W/2-t.W/2*a+(c.view.cx-t.view.cx)*t.view.k)*t.dpr,f=(t.H/2-t.H/2*a+(c.view.cy-t.view.cy)*t.view.k)*t.dpr;s.drawImage(c.img,n,f,c.img.width*a,c.img.height*a),s.setTransform(t.dpr,0,0,t.dpr,0,0),a===1&&n===0&&f===0&&W()>0&&fe(s,t.W,t.H,t.view,e,r,t.kFit,W(),!1)},E=()=>{const t=v.current;t.raf||(t.raf=requestAnimationFrame(()=>{t.raf=0,w()}))},Q=()=>{var s;const t=v.current;if(!((s=P.current)!=null&&s.heavy))return E();t.raf||(t.raf=requestAnimationFrame(()=>{t.raf=0,$()})),clearTimeout(C.current),C.current=window.setTimeout(E,160)},O=()=>{const t=v.current,s=P.current;s&&t.p>=1&&s.view.k===t.view.k&&s.view.cx===t.view.cx&&s.view.cy===t.view.cy?t.raf||(t.raf=requestAnimationFrame(()=>{t.raf=0,$()})):E()},X=(t,s,c=!1)=>{if(ye()){s(1),E();return}const a=performance.now(),n=f=>{var A;const m=Math.min(1,(f-a)/t);s(m),c&&m<1&&((A=P.current)!=null&&A.heavy)?$():w(),m<1&&requestAnimationFrame(n)};requestAnimationFrame(n)};ne(()=>{const t=v.current,s=()=>{const a=p.current.getBoundingClientRect(),n=!t.W;t.W=a.width,t.H=a.height,t.dpr=Math.min(2,devicePixelRatio||1),k.current.width=Math.round(t.W*t.dpr),k.current.height=Math.round(t.H*t.dpr);const f=we(r,t.W,t.H);t.view=n?f:{...t.view,k:t.view.k*(f.k/t.kFit)},t.kFit=f.k,w()},c=new ResizeObserver(s);return c.observe(p.current),t.p<1&&X(1100,a=>{t.p=a}),()=>{c.disconnect(),clearTimeout(C.current)}},[r]),ne(E,[h,u]),ne(O,[F]),ne(()=>{if(!g)return;const t=v.current,s={...t.view},c={k:Math.max(s.k,t.kFit*3.5),cx:r.x[g.i],cy:r.y[g.i]};X(700,a=>{const n=a<.5?4*a**3:1-(-2*a+2)**3/2;t.view={k:s.k*(c.k/s.k)**n,cx:s.cx+(c.cx-s.cx)*n,cy:s.cy+(c.cy-s.cy)*n}},!0)},[g]);const q=(t,s,c)=>{const a=v.current,n=a.view,f=(t-a.W/2)/n.k+n.cx,m=(s-a.H/2)/n.k+n.cy,A=Math.min(a.kFit*60,Math.max(a.kFit*.7,n.k*c));a.view={k:A,cx:f-(t-a.W/2)/A,cy:m-(s-a.H/2)/A},Q()},j=(t,s)=>{const c=v.current,a=c.view;for(const b of c.labels)if(t>=b[0]&&t<=b[0]+b[2]&&s>=b[1]&&s<=b[1]+b[3])return b[4];const n=(t-c.W/2)/a.k+a.cx,f=(s-c.H/2)/a.k+a.cy,m=pe(a.k,c.kFit);if(Math.hypot(n,f)*a.k<=xe(m))return 0;const A=30/a.k,z=Math.floor((n-A)/r.cell),D=Math.floor((n+A)/r.cell),L=Math.floor((f-A)/r.cell),I=Math.floor((f+A)/r.cell);let o=-1,M=1/0;for(let b=z;b<=D;b++)for(let B=L;B<=I;B++)for(const N of r.grid.get(b*100003+B)??[]){if(N===0||S.current.hidden[J(e,N)])continue;const le=r.size[N]*m,U=Math.hypot((r.x[N]-n)*a.k,(r.y[N]-f)*a.k);U<=Math.max(7,le+5)&&U-1.6*le<M&&(o=N,M=U-1.6*le)}return o};ne(()=>{const t=k.current,s=v.current,c=new Map;let a=0,n=0;const f=I=>{const o=t.getBoundingClientRect();return{x:I.clientX-o.left,y:I.clientY-o.top}},m=I=>{t.setPointerCapture(I.pointerId),c.set(I.pointerId,f(I)),a=0,n=0},A=I=>{const o=f(I);if(!c.has(I.pointerId)){if(I.pointerType!=="mouse")return;const b=j(o.x,o.y);b!==s.hover&&(s.hover=b,O()),R(b>=0?{i:b,x:o.x,y:o.y}:null),t.style.cursor=b>=0?"pointer":"grab";return}const M=c.get(I.pointerId);if(c.set(I.pointerId,o),c.size===1)a+=Math.abs(o.x-M.x)+Math.abs(o.y-M.y),s.view={...s.view,cx:s.view.cx-(o.x-M.x)/s.view.k,cy:s.view.cy-(o.y-M.y)/s.view.k},s.hover>=0&&(s.hover=-1,R(null)),Q();else if(c.size===2){const[b,B]=[...c.values()],N=Math.hypot(b.x-B.x,b.y-B.y);n&&q((b.x+B.x)/2,(b.y+B.y)/2,N/n),n=N,a=99}},z=I=>{const o=c.get(I.pointerId);if(c.delete(I.pointerId),c.size<2&&(n=0),o&&a<6&&c.size===0){const M=j(o.x,o.y);T.current(M>0?M:-1)}},D=I=>{I.preventDefault();const o=f(I);q(o.x,o.y,Math.exp(-I.deltaY*(I.deltaMode?.05:.0018)))},L=()=>{s.hover>=0&&(s.hover=-1,O()),R(null)};return t.addEventListener("pointerdown",m),t.addEventListener("pointermove",A),t.addEventListener("pointerup",z),t.addEventListener("pointercancel",z),t.addEventListener("pointerleave",L),t.addEventListener("wheel",D,{passive:!1}),()=>{t.removeEventListener("pointerdown",m),t.removeEventListener("pointermove",A),t.removeEventListener("pointerup",z),t.removeEventListener("pointercancel",z),t.removeEventListener("pointerleave",L),t.removeEventListener("wheel",D)}},[r]);const d=t=>{const s=v.current;q(s.W/2,s.H/2,t)},x=()=>{const t=v.current,s={...t.view},c=we(r,t.W,t.H);X(500,a=>{const n=1-(1-a)**3;t.view={k:s.k+(c.k-s.k)*n,cx:s.cx*(1-n),cy:s.cy*(1-n)}},!0)};return l("div",{class:"o-sky",ref:p,children:[l("canvas",{ref:k,role:"img","aria-label":`${_(r.n-1)} models built on ${e.root.id}, arranged by generation and kind`}),l("div",{class:"g-zoom",children:[l("button",{"aria-label":"Zoom in",onClick:()=>d(1.6),children:"+"}),l("button",{"aria-label":"Zoom out",onClick:()=>d(1/1.6),children:"−"}),l("button",{"aria-label":"Show everything",onClick:x,children:"⤢"})]}),y&&y.i!==u&&l("div",{class:"g-tip",style:{left:Math.min(y.x,(v.current.W||9999)-260),top:y.y},children:[l("b",{children:y.i===0?e.root.id:e.nodes.id[y.i]}),l("span",{children:[y.i===0?"the base model":`${G[J(e,y.i)].one}, ${he[r.depth[y.i]]} generation`,", ",se(e.nodes.dl30[y.i])," downloads a month",r.sub[y.i]>1?`, ${_(r.sub[y.i]-1)} built on it`:""]})]})]})}async function Pe(e,r){await Promise.all(["600 60px 'Fredoka'","500 20px 'IBM Plex Mono'","600 14px 'Source Sans 3'"].map(y=>document.fonts.load(y)));const h=1600,u=900,F=document.createElement("canvas");F.width=h,F.height=u;const i=F.getContext("2d"),g=(u/2-20)/r.extent;be(i,h,u,{k:g,cx:-290/g,cy:0},e,r,{p:1,hidden:[!1,!1,!1,!1],hover:-1,sel:-1,kFit:g,labels:14});const p=i.createLinearGradient(0,0,640,0);p.addColorStop(0,"rgba(251,250,245,1)"),p.addColorStop(.8,"rgba(251,250,245,0.92)"),p.addColorStop(1,"rgba(251,250,245,0)"),i.fillStyle=p,i.fillRect(0,0,640,u);const k=(y,R,W,w,$,E=520)=>{if(i.font=w,i.fillStyle=$,i.textBaseline="alphabetic",i.measureText(y).width>E){for(;y.length>3&&i.measureText(y+"…").width>E;)y=y.slice(0,-1);y+="…"}i.fillText(y,R,W)};i.fillStyle=H,i.beginPath(),i.roundRect(70,70,56,56,14),i.fill(),i.fillStyle=de,i.beginPath(),i.roundRect(64,64,56,56,14),i.fill(),i.lineWidth=4,i.strokeStyle=H,i.stroke(),i.beginPath(),i.lineWidth=5,i.lineJoin="round",i.lineCap="round",i.moveTo(74,94),i.lineTo(84,94),i.lineTo(90,78),i.lineTo(100,108),i.lineTo(106,94),i.lineTo(112,94),i.stroke(),k("Model Pulse Galaxy",138,104,"600 32px 'Fredoka'",H);const[v,S]=e.root.id.includes("/")?[e.root.id.split("/")[0],oe(e.root.id)]:["",e.root.id],P=S.length>18?50:64;k(v?v+"/":"",66,228,"500 24px 'IBM Plex Mono'",ie),i.font=`600 ${P}px 'Fredoka'`;const C=Math.min(540,i.measureText(S).width+28);i.fillStyle=de,i.beginPath(),i.roundRect(58,246,C,P+20,12),i.fill(),k(S,72,246+P+2,`600 ${P}px 'Fredoka'`,H,510),k(_(e.total),66,432,"600 72px 'Fredoka'",H),k("models built on it",68,470,"500 24px 'IBM Plex Mono'",ie);let T=560;for(const y of r.sectors)i.fillStyle=G[y.rel].color,i.beginPath(),i.arc(76,T-8,9,0,V),i.fill(),i.lineWidth=2,i.strokeStyle=H,i.stroke(),k(`${G[y.rel].label} ${_(r.byRel[y.rel].length)}`,98,T,"500 24px 'IBM Plex Mono'",H),T+=42;return k("modelpulse.ifsp.dev",66,u-50,"500 22px 'IBM Plex Mono'",ie),new Promise(y=>F.toBlob(R=>y(R),"image/png"))}function Ae({counts:e}){const r=e.reduce((h,u)=>h+u,0)||1;return l("span",{class:"o-bar","aria-hidden":"true",children:ue.map(h=>e[h]>0&&l("i",{style:{width:`${e[h]/r*100}%`,background:G[h].color}},h))})}function Ie(){const[e,r]=Y([]);return ne(()=>{document.title="Model galaxies: every model built on Llama, Qwen, FLUX and more · Model Pulse",ke("/api/galaxies").then(h=>r(h.slice(0,16))).catch(()=>{})},[]),l(ce,{children:[l("div",{class:"wrap w-entry g-entry",children:[l("h1",{children:[l(Se,{size:72}),"Model Pulse ",l("span",{class:"hl",children:"Galaxy"})]}),l("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."}),l("div",{class:"g-search",children:l(Te,{big:!0,placeholder:"A base model, e.g. meta-llama/Llama-3.1-8B",onPick:h=>Z({view:"galaxy",model:h})})})]}),e.length>0&&l("section",{class:"wrap g-fams",children:[l("h2",{children:"The biggest galaxies"}),l("div",{class:"g-grid",children:e.map(h=>l("a",{class:"g-fam",href:ee({view:"galaxy",model:h.id}),onClick:u=>{u.preventDefault(),Z({view:"galaxy",model:h.id})},children:[l("span",{class:"o",children:[h.id.split("/")[0],"/"]}),l("span",{class:"nm",children:oe(h.id)}),l(Ae,{counts:[h.n_quantized,h.n_finetune,h.n_adapter,h.n_merge]}),l("span",{class:"c",children:[l("b",{children:_(h.fam_members)})," models, ",se(h.fam_dl30)," downloads a month"]})]},h.id))})]})]})}function Ee({model:e}){const[r,h]=Y(null),[u,F]=Y(null),[i,g]=Y([!1,!1,!1,!1]),[p,k]=Y(-1),[v,S]=Y(-1),[P,C]=Y(null),[T,y]=Y(""),[R,W]=Y(!1);ne(()=>{e&&(document.title=`${e} galaxy: every model built on it · Model Pulse`,h(null),F(null),k(-1),y(""),ke(`/api/galaxy/${e}`).then(n=>{h(n),document.title=`${n.root.id} galaxy: ${n.total.toLocaleString("en")} models built on it · Model Pulse`}).catch(n=>F(n.message)))},[e]);const w=ae(()=>r?Ce(r):null,[r]),$=ae(()=>r?r.nodes.id.map(n=>n.toLowerCase()):[],[r]),E=ae(()=>{const n=T.trim().toLowerCase();if(!w||n.length<2)return[];const f=[];for(let m=0;m<w.n&&f.length<8;m++)w.order[m]>0&&$[w.order[m]].includes(n)&&f.push(w.order[m]);return f},[T,w,$]),Q=ae(()=>{if(!r)return[];const n=r.root.id.split("/")[0],f=new Map;return r.nodes.id.forEach((m,A)=>{if(!A)return;const z=m.split("/")[0];if(z===n)return;const D=f.get(z)??{n:0,dl:0};D.n++,D.dl+=r.nodes.dl30[A]||0,f.set(z,D)}),[...f.entries()].sort((m,A)=>A[1].dl-m[1].dl).slice(0,6)},[r]);if(!e)return l(Ie,{});if(u)return l("div",{class:"wrap err",children:[l("h1",{children:"No galaxy to show"}),l("p",{children:u})]});const O=r==null?void 0:r.root,[X,q]=e.includes("/")?[e.split("/")[0],oe(e)]:["",e],j=n=>{k(n),y(""),n>0&&C({i:n,n:Date.now()})},d=ve({view:"galaxy",model:(O==null?void 0:O.id)??e}),x=O?`${_(r.total)} models are built on ${O.id}. Here is its whole galaxy:`:"",t=r!=null&&r.lineage.length?r.lineage[r.lineage.length-1]:null,s=w?[0,1,2,3].map(n=>w.byRel[n].length):[0,0,0,0],c=w?Array.from(w.order).filter(n=>n>0).slice(0,12):[],a=n=>G[J(r,n)];return l("div",{class:"galaxy",children:[l("div",{class:"wrap g-head",children:[l("div",{class:"crumbs",children:[l("a",{class:"chip",href:ee({view:"galaxy"}),onClick:n=>{n.preventDefault(),Z({view:"galaxy"})},children:"All galaxies"}),t&&l("a",{class:"chip chip-hot",href:ee({view:"galaxy",model:t}),onClick:n=>{n.preventDefault(),Z({view:"galaxy",model:t})},children:["Part of the ",oe(t)," galaxy"]}),l("a",{class:"chip",href:ee({model:e}),onClick:n=>{n.preventDefault(),Z({model:e})},children:"Download history"})]}),l("h1",{class:"model-name",children:[X&&l(ce,{children:[l("span",{class:"org",children:[X,"/"]}),l("wbr",{})]}),l("span",{class:"hl",children:q})]}),l("p",{class:"g-lede",children:r?r.total?l(ce,{children:[l("b",{children:_(r.total)})," models are built on ",q,", directly or through other derivatives. Together with the original they were downloaded ",l("b",{children:se(O.fam_dl30)})," times in the last 30 days."]}):l(ce,{children:["No models on the Hub are built on ",q," yet."]}):"Mapping every model built on it…"})]}),l("div",{class:"wrap o-layout",children:[l("div",{class:"o-stage",children:[r&&w&&r.total>0?l(Fe,{g:r,L:w,hidden:i,sel:p,hoverExt:v,onSel:k,flyTo:P}):l("div",{class:"o-sky o-empty",children:r?l("span",{children:"Nothing orbits this model yet."}):l("span",{class:"g-loading",children:"Mapping the galaxy…"})}),l("ul",{class:"o-key",children:[l("li",{children:[l("span",{class:"k-sun","aria-hidden":"true"}),q," in the center"]}),l("li",{children:[l("span",{class:"k-ring","aria-hidden":"true"}),"one orbit per generation"]}),l("li",{children:[l("span",{class:"k-size","aria-hidden":"true"}),"bigger planet, more downloads"]}),l("li",{children:[l("span",{class:"k-line","aria-hidden":"true"}),"line to the model it was made from"]})]}),r&&w&&r.total>0&&l("div",{class:"g-foot",children:[w.n-1<r.total&&l("p",{class:"muted",children:["Showing the ",_(w.n-1)," most downloaded of ",_(r.total)," models."]}),l("div",{class:"w-actions g-actions",children:[l("button",{class:"btn primary",disabled:R,onClick:async()=>{W(!0);try{const n=await Pe(r,w),f=document.createElement("a");f.href=URL.createObjectURL(n),f.download=`${r.root.id.replace("/","_")}-galaxy.png`,f.click(),setTimeout(()=>URL.revokeObjectURL(f.href),2e3)}finally{W(!1)}},children:R?"Drawing…":"Download image"}),l("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(x)}&url=${encodeURIComponent(d)}`,children:"Post on X"}),l("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(d)}`,children:"LinkedIn"}),l("button",{class:"btn",onClick:()=>{var n;return(n=navigator.clipboard)==null?void 0:n.writeText(d)},children:"Copy link"}),l(Me,{})]})]})]}),r&&w&&r.total>0&&l("aside",{class:"o-panel",children:[l("div",{class:"g-find",children:[l("input",{value:T,onInput:n=>y(n.target.value),placeholder:"Find a model in this galaxy","aria-label":"Find a model in this galaxy",spellcheck:!1,onKeyDown:n=>{n.key==="Enter"&&E.length&&j(E[0]),n.key==="Escape"&&y("")}}),E.length>0&&l("ul",{class:"g-found",children:E.map(n=>l("li",{children:l("button",{onClick:()=>j(n),children:[l("span",{children:r.nodes.id[n]}),l("small",{children:[se(r.nodes.dl30[n]),"/mo"]})]})},n))})]}),p>0&&l("div",{class:"o-sel",children:[l("button",{class:"x","aria-label":"Close",onClick:()=>k(-1),children:"×"}),l("a",{class:"id",href:ee({model:r.nodes.id[p]}),onClick:n=>{n.preventDefault(),Z({model:r.nodes.id[p]})},children:r.nodes.id[p]}),l("span",{class:"g-rel",children:[l("i",{style:{background:a(p).color}}),a(p).of," ",oe(r.nodes.id[r.nodes.parent[p]]),", ",he[w.depth[p]]," generation"]}),l("span",{class:"n",children:[l("b",{children:_(r.nodes.dl30[p])})," downloads in the last 30 days"]}),w.sub[p]>1&&l("span",{class:"n",children:[l("b",{children:_(w.sub[p]-1)})," models built on it"]}),l("div",{class:"acts",children:[l("a",{class:"btn primary",href:ee({model:r.nodes.id[p]}),onClick:n=>{n.preventDefault(),Z({model:r.nodes.id[p]})},children:"Download history"}),w.sub[p]>1&&l("a",{class:"btn",href:ee({view:"galaxy",model:r.nodes.id[p]}),onClick:n=>{n.preventDefault(),Z({view:"galaxy",model:r.nodes.id[p]})},children:"Its own galaxy"})]})]}),l("section",{children:[l("h2",{children:"By kind"}),l("p",{class:"o-note",children:"All generations. Click to show or hide."}),l("div",{class:"o-kinds",role:"group","aria-label":"Show or hide kinds of derivatives",children:ue.filter(n=>s[n]>0).map(n=>l("button",{"aria-pressed":!i[n],onClick:()=>g(i.map((f,m)=>m===n?!f:f)),children:[l("i",{style:{background:G[n].color}}),l("span",{children:G[n].label}),l("b",{children:_(s[n])}),l("span",{class:"share",children:l("span",{style:{width:`${s[n]/(w.n-1)*100}%`,background:G[n].color}})})]},n))}),l("p",{class:"o-gens",children:w.gens.slice(1).map((n,f)=>n?l("span",{children:[l("b",{children:_(n)})," ",he[f+1]," generation"]},f):null)})]}),l("section",{children:[l("h2",{children:"Most downloaded"}),l("ol",{class:"o-top",children:c.map(n=>l("li",{children:l("button",{class:p===n?"on":"",onClick:()=>j(n),onMouseEnter:()=>S(n),onMouseLeave:()=>S(-1),onFocus:()=>S(n),onBlur:()=>S(-1),children:[l("i",{style:{background:a(n).color}}),l("span",{class:"nm",children:r.nodes.id[n]}),l("span",{class:"v",children:se(r.nodes.dl30[n])})]})},n))})]}),Q.length>0&&l("section",{children:[l("h2",{children:"Who builds on it"}),l("ol",{class:"o-top",children:Q.map(([n,f])=>l("li",{children:l("a",{href:ee({author:n}),onClick:m=>{m.preventDefault(),Z({author:n})},children:[l("span",{class:"nm",children:n}),l("span",{class:"v",children:[_(f.n)," ",f.n===1?"model":"models"]})]})},n))})]})]})]})]})}export{Ee as Galaxy};
|
|
|
|
| 1 |
+
import{d as Y,h as ne,g as ke,T as ae,u as l,s as ve,f as _,n as Z,a as ee,S as ce,b as se,L as Me,c as Se,e as Te,A as te}from"./index-BOlziVv0.js";const G=[{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"}],ue=[1,2,0,3],H="#1b1b1f",re="#fbfaf5",de="#ffd21e",ie="#63615b",me=[0,330,590,800,960],V=Math.PI*2,he=["","1st","2nd","3rd","4th+"],ye=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,oe=e=>e.split("/").pop()??e,J=(e,r)=>e.nodes.rel[r]>=0?e.nodes.rel[r]:1;function ge(e,r){let h=Math.imul(e^2654435769,2246822507)^Math.imul(r+1,3266489909);return h^=h>>>13,h=Math.imul(h,668265263),h^=h>>>16,(h>>>0)/4294967296}function Ce(e){const{parent:r,dl30:h}=e.nodes,u=r.length,F=new Uint8Array(u),i=new Int32Array(u).fill(1),g=new Int32Array(u+1);for(let o=1;o<u;o++)F[o]=Math.min(4,F[r[o]]+1),g[r[o]+1]++;for(let o=0;o<u;o++)g[o+1]+=g[o];const p=g.slice(0,u),k=new Int32Array(Math.max(0,u-1));for(let o=1;o<u;o++)k[p[r[o]]++]=o;for(let o=u-1;o>0;o--)i[r[o]]+=i[o];const v=[0,0,0,0,0];for(let o=1;o<u;o++)v[F[o]]++;const S=o=>1+Math.pow(i[o]-1,.8),P=new Float32Array(u),C=new Float32Array(u),T=new Float32Array(u),y=new Float32Array(u),R=(o,M,b)=>{o.sort((U,K)=>S(K)-S(U)||(h[K]||0)-(h[U]||0));const B=[];o.forEach((U,K)=>K%2?B.unshift(U):B.push(U));const N=B.reduce((U,K)=>U+S(K),0)||1;let le=M;for(const U of B){const K=(b-M)*S(U)/N;P[U]=le+K/2,C[U]=K,le+=K}},W=Array.from(k.subarray(g[0],g[1])),w=[0,1,2,3].map(o=>W.filter(M=>J(e,M)===o)),$=ue.filter(o=>w[o].length),E=$.length>1?.05:0,Q=$.map(o=>Math.sqrt(w[o].reduce((M,b)=>M+S(b),0))),O=Q.reduce((o,M)=>o+M,0)||1,X=$.length>1?.12:1,q=Q.map(o=>Math.max(X,o/O)),j=q.reduce((o,M)=>o+M,0),d=V-E*$.length,x=[];let t=-Math.PI/2-q[0]/j*d/2;$.forEach((o,M)=>{const b=q[M]/j*d;x.push({rel:o,a0:t,a1:t+b,count:w[o].length}),R(w[o],t,t+b),t+=b+E});for(let o=1;o<u;o++)g[o+1]>g[o]&&R(Array.from(k.subarray(g[o],g[o+1])),P[o]-C[o]/2,P[o]+C[o]/2);let s=1;for(let o=1;o<u;o++)s=Math.max(s,h[o]||0);const c=new Float32Array(u);for(let o=1;o<u;o++)c[o]=(h[o]||0)>0?Math.min(24,1.6+22*Math.sqrt((h[o]||0)/s)):1.2;const a=v.map(o=>Math.max(14,Math.min(120,Math.sqrt(o)*1.3)));for(let o=1;o<u;o++){const M=F[o],b=c[o]>=5,B=me[M]+(b?0:(ge(o,1)-.5)*a[M]),N=b?P[o]:P[o]+(ge(o,2)-.5)*Math.min(C[o]*.9,.08);T[o]=Math.cos(N)*B,y[o]=Math.sin(N)*B}const n=Int32Array.from({length:u},(o,M)=>M).sort((o,M)=>(h[M]||0)-(h[o]||0)),f=[0,1,2,3].map(o=>Int32Array.from({length:u},(M,b)=>b).filter(M=>M>0&&J(e,M)===o)),m=n.filter(o=>o>0&&(h[o]||0)>0).slice(0,160),A=v.reduce((o,M,b)=>M?b:o,1),z=me.slice(1,A+1),D=z[z.length-1]+a[A]/2+120,L=24,I=new Map;for(let o=0;o<u;o++){const M=Math.floor(T[o]/L)*100003+Math.floor(y[o]/L),b=I.get(M);b?b.push(o):I.set(M,[o])}return{n:u,x:T,y,ang:P,size:c,depth:F,sub:i,start:g,kids:k,byRel:f,order:n,rings:z,sectors:x,gens:v,extent:D,cell:L,grid:I,links:m}}const pe=(e,r)=>Math.min(2.6,Math.max(1,Math.sqrt(e/r))),xe=e=>22+6*(e-1);function be(e,r,h,u,F,i,g){const{x:p,y:k,size:v}=i,S=d=>(d-u.cx)*u.k+r/2,P=d=>(d-u.cy)*u.k+h/2,C=S(0),T=P(0),y=pe(u.k,g.kFit),R=g.p>=1?1:1-(1-g.p)**3;e.globalAlpha=1,e.fillStyle=re,e.fillRect(0,0,r,h);for(const d of i.sectors)g.hidden[d.rel]||(e.beginPath(),e.moveTo(C,T),e.arc(C,T,(i.extent-60)*u.k,d.a0,d.a1),e.closePath(),e.fillStyle=G[d.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 d of i.rings)e.beginPath(),e.arc(C,T,d*u.k*R,0,V),e.stroke();e.setLineDash([]),e.strokeStyle=H,e.lineWidth=1,e.globalAlpha=.16*R,e.beginPath();for(const d of i.links){const x=F.nodes.parent[d];g.hidden[J(F,d)]||(e.moveTo(S(p[x]*R),P(k[x]*R)),e.lineTo(S(p[d]*R),P(k[d]*R)))}e.stroke(),e.globalAlpha=1;for(let d=0;d<4;d++){if(g.hidden[d])continue;e.fillStyle=G[d].color,e.globalAlpha=.5;const x=new Path2D;for(const t of i.byRel[d]){if(v[t]>=5)continue;const s=S(p[t]*R),c=P(k[t]*R),a=v[t]*y;s<-a||c<-a||s>r+a||c>h+a||(a<1.6?x.rect(s-a,c-a,a*2,a*2):(x.moveTo(s+a,c),x.arc(s,c,a,0,V)))}e.fill(x)}e.globalAlpha=1;for(let d=i.n-1;d>=0;d--){const x=i.order[d];if(x===0||v[x]<5||g.hidden[J(F,x)])continue;const t=S(p[x]*R),s=P(k[x]*R),c=v[x]*y;e.beginPath(),e.arc(t,s,c,0,V),e.fillStyle=G[J(F,x)].color,e.fill(),e.lineWidth=2,e.strokeStyle=H,e.stroke()}const W=xe(y);e.beginPath(),e.arc(C+4,T+4,W,0,V),e.fillStyle=H,e.fill(),e.beginPath(),e.arc(C,T,W,0,V),e.fillStyle=de,e.fill(),e.lineWidth=3,e.strokeStyle=H,e.stroke();for(const d of[g.sel,g.hover])d>0&&fe(e,r,h,u,F,i,g.kFit,d,d===g.sel);if(g.p<1)return;const w=[[C-W-6,T-W-6,W*2+12,W*2+12],[r-64,0,64,150]];for(const d of i.links){if(g.hidden[J(F,d)]||v[d]<5)continue;const x=v[d]*y;w.push([S(p[d])-x,P(k[d])-x,x*2,x*2])}e.textBaseline="middle",e.lineJoin="round";for(const d of i.sectors){if(g.hidden[d.rel])continue;const x=(d.a0+d.a1)/2,t=(i.extent-70)*u.k,s=C+Math.cos(x)*t,c=T+Math.sin(x)*t,a=G[d.rel].label,n=`${_(d.count)} direct`;e.font="600 13px 'IBM Plex Mono', ui-monospace, monospace";const f=e.measureText(`${a} ${n}`).width,m=Math.max(6,Math.min(r-f-6,s-f/2));c<10||c>h-10||(e.lineWidth=4,e.strokeStyle=re,e.strokeText(`${a} ${n}`,m,c),e.fillStyle=G[d.rel].color,e.fillText(a,m,c),e.fillStyle=H,e.fillText(n,m+e.measureText(`${a} `).width,c),w.push([m-2,c-10,f+4,20]))}e.font="500 11.5px 'IBM Plex Mono', ui-monospace, monospace",i.rings.forEach((d,x)=>{const t=`${he[x+1]} generation`,s=e.measureText(t).width,c=C-s/2,a=T+d*u.k+11;a<8||a>h-8||(e.lineWidth=4,e.strokeStyle=re,e.strokeText(t,c,a),e.fillStyle=ie,e.fillText(t,c,a),w.push([c-2,a-8,s+4,16]))}),e.font="600 15px 'Fredoka', system-ui, sans-serif";const $=oe(F.root.id),E=e.measureText($).width,Q=T+W+16;Q<h-8&&(e.lineWidth=5,e.strokeStyle=re,e.strokeText($,C-E/2,Q),e.fillStyle=H,e.fillText($,C-E/2,Q),w.push([C-E/2-2,Q-10,E+4,20]));const O=g.labels??Math.min(40,Math.round(14+10*Math.max(0,Math.log2(u.k/g.kFit)))),X=new Set;e.font="600 13px 'Source Sans 3', system-ui, sans-serif";let q=0;const j=(d,x=!1)=>{var z;const t=oe(F.nodes.id[d]);if(!x&&X.has(t))return;const s=S(p[d]),c=P(k[d]),a=v[d]*y,n=Math.cos(i.ang[d])>=-.1,f=e.measureText(t).width,m=n?s+a+5:s-a-5-f,A=c-9;m<4||A<4||m+f>r-4||A+18>h-4||!x&&w.some(D=>m<D[0]+D[2]&&m+f>D[0]&&A<D[1]+D[3]&&A+18>D[1])||(w.push([m-2,A,f+4,18]),(z=g.labelHits)==null||z.push([m-2,A,f+4,18,d]),X.add(t),e.lineWidth=4,e.strokeStyle=re,e.strokeText(t,m,c),e.fillStyle=H,e.fillText(t,m,c),q++)};g.sel>0&&j(g.sel,!0);for(let d=0;d<Math.min(i.n,800)&&q<O;d++){const x=i.order[d];x>0&&(F.nodes.dl30[x]||0)>0&&!g.hidden[J(F,x)]&&j(x)}}function fe(e,r,h,u,F,i,g,p,k){const v=T=>(i.x[T]-u.cx)*u.k+r/2,S=T=>(i.y[T]-u.cy)*u.k+h/2,P=pe(u.k,g);e.globalAlpha=.5,e.strokeStyle=G[J(F,p)].color,e.lineWidth=1.2,e.beginPath();for(let T=i.start[p];T<i.start[p+1]&&T<i.start[p]+400;T++){const y=i.kids[T];e.moveTo(v(p),S(p)),e.lineTo(v(y),S(y))}e.stroke(),e.globalAlpha=1,e.strokeStyle=H,e.lineWidth=2.5,e.beginPath();let C=p;for(e.moveTo(v(C),S(C));C>0;)C=F.nodes.parent[C],e.lineTo(v(C),S(C));e.stroke(),e.beginPath(),e.arc(v(p),S(p),Math.max(5,i.size[p]*P)+5,0,V),e.lineWidth=3,e.strokeStyle=k?H:ie,e.stroke(),k&&(e.beginPath(),e.arc(v(p),S(p),Math.max(5,i.size[p]*P)+9,0,V),e.lineWidth=2,e.strokeStyle=de,e.stroke())}const we=(e,r,h)=>({k:(Math.min(r,h)/2-8)/e.extent,cx:0,cy:0});function Fe({g:e,L:r,hidden:h,sel:u,hoverExt:F,onSel:i,flyTo:g}){const p=te(null),k=te(null),v=te({W:0,H:0,dpr:1,view:{k:1,cx:0,cy:0},kFit:1,p:ye()?1:0,hover:-1,raf:0,labels:[]}),S=te({hidden:h,sel:u,hoverExt:F});S.current={hidden:h,sel:u,hoverExt:F};const P=te(null),C=te(0),T=te(i);T.current=i;const[y,R]=Y(null),W=()=>S.current.hoverExt>0?S.current.hoverExt:v.current.hover,w=()=>{var a,n;const t=v.current,s=(a=k.current)==null?void 0:a.getContext("2d");if(!s||!t.W)return;s.setTransform(t.dpr,0,0,t.dpr,0,0),t.labels=[];const c=performance.now();if(be(s,t.W,t.H,t.view,e,r,{p:t.p,hidden:S.current.hidden,hover:-1,sel:S.current.sel,kFit:t.kFit,labelHits:t.labels}),t.p>=1){const f=((n=P.current)==null?void 0:n.img)??document.createElement("canvas");(f.width!==k.current.width||f.height!==k.current.height)&&(f.width=k.current.width,f.height=k.current.height);const m=f.getContext("2d");m.setTransform(1,0,0,1,0,0),m.drawImage(k.current,0,0),P.current={img:f,view:{...t.view},heavy:performance.now()-c>22}}W()>0&&fe(s,t.W,t.H,t.view,e,r,t.kFit,W(),!1)},$=()=>{var m;const t=v.current,s=(m=k.current)==null?void 0:m.getContext("2d"),c=P.current;if(!s||!c)return w();const a=t.view.k/c.view.k;s.setTransform(1,0,0,1,0,0),s.fillStyle=re,s.fillRect(0,0,k.current.width,k.current.height);const n=(t.W/2-t.W/2*a+(c.view.cx-t.view.cx)*t.view.k)*t.dpr,f=(t.H/2-t.H/2*a+(c.view.cy-t.view.cy)*t.view.k)*t.dpr;s.drawImage(c.img,n,f,c.img.width*a,c.img.height*a),s.setTransform(t.dpr,0,0,t.dpr,0,0),a===1&&n===0&&f===0&&W()>0&&fe(s,t.W,t.H,t.view,e,r,t.kFit,W(),!1)},E=()=>{const t=v.current;t.raf||(t.raf=requestAnimationFrame(()=>{t.raf=0,w()}))},Q=()=>{var s;const t=v.current;if(!((s=P.current)!=null&&s.heavy))return E();t.raf||(t.raf=requestAnimationFrame(()=>{t.raf=0,$()})),clearTimeout(C.current),C.current=window.setTimeout(E,160)},O=()=>{const t=v.current,s=P.current;s&&t.p>=1&&s.view.k===t.view.k&&s.view.cx===t.view.cx&&s.view.cy===t.view.cy?t.raf||(t.raf=requestAnimationFrame(()=>{t.raf=0,$()})):E()},X=(t,s,c=!1)=>{if(ye()){s(1),E();return}const a=performance.now(),n=f=>{var A;const m=Math.min(1,(f-a)/t);s(m),c&&m<1&&((A=P.current)!=null&&A.heavy)?$():w(),m<1&&requestAnimationFrame(n)};requestAnimationFrame(n)};ne(()=>{const t=v.current,s=()=>{const a=p.current.getBoundingClientRect(),n=!t.W;t.W=a.width,t.H=a.height,t.dpr=Math.min(2,devicePixelRatio||1),k.current.width=Math.round(t.W*t.dpr),k.current.height=Math.round(t.H*t.dpr);const f=we(r,t.W,t.H);t.view=n?f:{...t.view,k:t.view.k*(f.k/t.kFit)},t.kFit=f.k,w()},c=new ResizeObserver(s);return c.observe(p.current),t.p<1&&X(1100,a=>{t.p=a}),()=>{c.disconnect(),clearTimeout(C.current)}},[r]),ne(E,[h,u]),ne(O,[F]),ne(()=>{if(!g)return;const t=v.current,s={...t.view},c={k:Math.max(s.k,t.kFit*3.5),cx:r.x[g.i],cy:r.y[g.i]};X(700,a=>{const n=a<.5?4*a**3:1-(-2*a+2)**3/2;t.view={k:s.k*(c.k/s.k)**n,cx:s.cx+(c.cx-s.cx)*n,cy:s.cy+(c.cy-s.cy)*n}},!0)},[g]);const q=(t,s,c)=>{const a=v.current,n=a.view,f=(t-a.W/2)/n.k+n.cx,m=(s-a.H/2)/n.k+n.cy,A=Math.min(a.kFit*60,Math.max(a.kFit*.7,n.k*c));a.view={k:A,cx:f-(t-a.W/2)/A,cy:m-(s-a.H/2)/A},Q()},j=(t,s)=>{const c=v.current,a=c.view;for(const b of c.labels)if(t>=b[0]&&t<=b[0]+b[2]&&s>=b[1]&&s<=b[1]+b[3])return b[4];const n=(t-c.W/2)/a.k+a.cx,f=(s-c.H/2)/a.k+a.cy,m=pe(a.k,c.kFit);if(Math.hypot(n,f)*a.k<=xe(m))return 0;const A=30/a.k,z=Math.floor((n-A)/r.cell),D=Math.floor((n+A)/r.cell),L=Math.floor((f-A)/r.cell),I=Math.floor((f+A)/r.cell);let o=-1,M=1/0;for(let b=z;b<=D;b++)for(let B=L;B<=I;B++)for(const N of r.grid.get(b*100003+B)??[]){if(N===0||S.current.hidden[J(e,N)])continue;const le=r.size[N]*m,U=Math.hypot((r.x[N]-n)*a.k,(r.y[N]-f)*a.k);U<=Math.max(7,le+5)&&U-1.6*le<M&&(o=N,M=U-1.6*le)}return o};ne(()=>{const t=k.current,s=v.current,c=new Map;let a=0,n=0;const f=I=>{const o=t.getBoundingClientRect();return{x:I.clientX-o.left,y:I.clientY-o.top}},m=I=>{t.setPointerCapture(I.pointerId),c.set(I.pointerId,f(I)),a=0,n=0},A=I=>{const o=f(I);if(!c.has(I.pointerId)){if(I.pointerType!=="mouse")return;const b=j(o.x,o.y);b!==s.hover&&(s.hover=b,O()),R(b>=0?{i:b,x:o.x,y:o.y}:null),t.style.cursor=b>=0?"pointer":"grab";return}const M=c.get(I.pointerId);if(c.set(I.pointerId,o),c.size===1)a+=Math.abs(o.x-M.x)+Math.abs(o.y-M.y),s.view={...s.view,cx:s.view.cx-(o.x-M.x)/s.view.k,cy:s.view.cy-(o.y-M.y)/s.view.k},s.hover>=0&&(s.hover=-1,R(null)),Q();else if(c.size===2){const[b,B]=[...c.values()],N=Math.hypot(b.x-B.x,b.y-B.y);n&&q((b.x+B.x)/2,(b.y+B.y)/2,N/n),n=N,a=99}},z=I=>{const o=c.get(I.pointerId);if(c.delete(I.pointerId),c.size<2&&(n=0),o&&a<6&&c.size===0){const M=j(o.x,o.y);T.current(M>0?M:-1)}},D=I=>{I.preventDefault();const o=f(I);q(o.x,o.y,Math.exp(-I.deltaY*(I.deltaMode?.05:.0018)))},L=()=>{s.hover>=0&&(s.hover=-1,O()),R(null)};return t.addEventListener("pointerdown",m),t.addEventListener("pointermove",A),t.addEventListener("pointerup",z),t.addEventListener("pointercancel",z),t.addEventListener("pointerleave",L),t.addEventListener("wheel",D,{passive:!1}),()=>{t.removeEventListener("pointerdown",m),t.removeEventListener("pointermove",A),t.removeEventListener("pointerup",z),t.removeEventListener("pointercancel",z),t.removeEventListener("pointerleave",L),t.removeEventListener("wheel",D)}},[r]);const d=t=>{const s=v.current;q(s.W/2,s.H/2,t)},x=()=>{const t=v.current,s={...t.view},c=we(r,t.W,t.H);X(500,a=>{const n=1-(1-a)**3;t.view={k:s.k+(c.k-s.k)*n,cx:s.cx*(1-n),cy:s.cy*(1-n)}},!0)};return l("div",{class:"o-sky",ref:p,children:[l("canvas",{ref:k,role:"img","aria-label":`${_(r.n-1)} models built on ${e.root.id}, arranged by generation and kind`}),l("div",{class:"g-zoom",children:[l("button",{"aria-label":"Zoom in",onClick:()=>d(1.6),children:"+"}),l("button",{"aria-label":"Zoom out",onClick:()=>d(1/1.6),children:"−"}),l("button",{"aria-label":"Show everything",onClick:x,children:"⤢"})]}),y&&y.i!==u&&l("div",{class:"g-tip",style:{left:Math.min(y.x,(v.current.W||9999)-260),top:y.y},children:[l("b",{children:y.i===0?e.root.id:e.nodes.id[y.i]}),l("span",{children:[y.i===0?"the base model":`${G[J(e,y.i)].one}, ${he[r.depth[y.i]]} generation`,", ",se(e.nodes.dl30[y.i])," downloads a month",r.sub[y.i]>1?`, ${_(r.sub[y.i]-1)} built on it`:""]})]})]})}async function Pe(e,r){await Promise.all(["600 60px 'Fredoka'","500 20px 'IBM Plex Mono'","600 14px 'Source Sans 3'"].map(y=>document.fonts.load(y)));const h=1600,u=900,F=document.createElement("canvas");F.width=h,F.height=u;const i=F.getContext("2d"),g=(u/2-20)/r.extent;be(i,h,u,{k:g,cx:-290/g,cy:0},e,r,{p:1,hidden:[!1,!1,!1,!1],hover:-1,sel:-1,kFit:g,labels:14});const p=i.createLinearGradient(0,0,640,0);p.addColorStop(0,"rgba(251,250,245,1)"),p.addColorStop(.8,"rgba(251,250,245,0.92)"),p.addColorStop(1,"rgba(251,250,245,0)"),i.fillStyle=p,i.fillRect(0,0,640,u);const k=(y,R,W,w,$,E=520)=>{if(i.font=w,i.fillStyle=$,i.textBaseline="alphabetic",i.measureText(y).width>E){for(;y.length>3&&i.measureText(y+"…").width>E;)y=y.slice(0,-1);y+="…"}i.fillText(y,R,W)};i.fillStyle=H,i.beginPath(),i.roundRect(70,70,56,56,14),i.fill(),i.fillStyle=de,i.beginPath(),i.roundRect(64,64,56,56,14),i.fill(),i.lineWidth=4,i.strokeStyle=H,i.stroke(),i.beginPath(),i.lineWidth=5,i.lineJoin="round",i.lineCap="round",i.moveTo(74,94),i.lineTo(84,94),i.lineTo(90,78),i.lineTo(100,108),i.lineTo(106,94),i.lineTo(112,94),i.stroke(),k("Model Pulse Galaxy",138,104,"600 32px 'Fredoka'",H);const[v,S]=e.root.id.includes("/")?[e.root.id.split("/")[0],oe(e.root.id)]:["",e.root.id],P=S.length>18?50:64;k(v?v+"/":"",66,228,"500 24px 'IBM Plex Mono'",ie),i.font=`600 ${P}px 'Fredoka'`;const C=Math.min(540,i.measureText(S).width+28);i.fillStyle=de,i.beginPath(),i.roundRect(58,246,C,P+20,12),i.fill(),k(S,72,246+P+2,`600 ${P}px 'Fredoka'`,H,510),k(_(e.total),66,432,"600 72px 'Fredoka'",H),k("models built on it",68,470,"500 24px 'IBM Plex Mono'",ie);let T=560;for(const y of r.sectors)i.fillStyle=G[y.rel].color,i.beginPath(),i.arc(76,T-8,9,0,V),i.fill(),i.lineWidth=2,i.strokeStyle=H,i.stroke(),k(`${G[y.rel].label} ${_(r.byRel[y.rel].length)}`,98,T,"500 24px 'IBM Plex Mono'",H),T+=42;return k("modelpulse.ifsp.dev",66,u-50,"500 22px 'IBM Plex Mono'",ie),new Promise(y=>F.toBlob(R=>y(R),"image/png"))}function Ae({counts:e}){const r=e.reduce((h,u)=>h+u,0)||1;return l("span",{class:"o-bar","aria-hidden":"true",children:ue.map(h=>e[h]>0&&l("i",{style:{width:`${e[h]/r*100}%`,background:G[h].color}},h))})}function Ie(){const[e,r]=Y([]);return ne(()=>{document.title="Model galaxies: every model built on Llama, Qwen, FLUX and more · Model Pulse",ke("/api/galaxies").then(h=>r(h.slice(0,16))).catch(()=>{})},[]),l(ce,{children:[l("div",{class:"wrap w-entry g-entry",children:[l("h1",{children:[l(Se,{size:72}),"Model Pulse ",l("span",{class:"hl",children:"Galaxy"})]}),l("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."}),l("div",{class:"g-search",children:l(Te,{big:!0,placeholder:"A base model, e.g. meta-llama/Llama-3.1-8B",onPick:h=>Z({view:"galaxy",model:h})})})]}),e.length>0&&l("section",{class:"wrap g-fams",children:[l("h2",{children:"The biggest galaxies"}),l("div",{class:"g-grid",children:e.map(h=>l("a",{class:"g-fam",href:ee({view:"galaxy",model:h.id}),onClick:u=>{u.preventDefault(),Z({view:"galaxy",model:h.id})},children:[l("span",{class:"o",children:[h.id.split("/")[0],"/"]}),l("span",{class:"nm",children:oe(h.id)}),l(Ae,{counts:[h.n_quantized,h.n_finetune,h.n_adapter,h.n_merge]}),l("span",{class:"c",children:[l("b",{children:_(h.fam_members)})," models, ",se(h.fam_dl30)," downloads a month"]})]},h.id))})]})]})}function Ee({model:e}){const[r,h]=Y(null),[u,F]=Y(null),[i,g]=Y([!1,!1,!1,!1]),[p,k]=Y(-1),[v,S]=Y(-1),[P,C]=Y(null),[T,y]=Y(""),[R,W]=Y(!1);ne(()=>{e&&(document.title=`${e} galaxy: every model built on it · Model Pulse`,h(null),F(null),k(-1),y(""),ke(`/api/galaxy/${e}`).then(n=>{h(n),document.title=`${n.root.id} galaxy: ${n.total.toLocaleString("en")} models built on it · Model Pulse`}).catch(n=>F(n.message)))},[e]);const w=ae(()=>r?Ce(r):null,[r]),$=ae(()=>r?r.nodes.id.map(n=>n.toLowerCase()):[],[r]),E=ae(()=>{const n=T.trim().toLowerCase();if(!w||n.length<2)return[];const f=[];for(let m=0;m<w.n&&f.length<8;m++)w.order[m]>0&&$[w.order[m]].includes(n)&&f.push(w.order[m]);return f},[T,w,$]),Q=ae(()=>{if(!r)return[];const n=r.root.id.split("/")[0],f=new Map;return r.nodes.id.forEach((m,A)=>{if(!A)return;const z=m.split("/")[0];if(z===n)return;const D=f.get(z)??{n:0,dl:0};D.n++,D.dl+=r.nodes.dl30[A]||0,f.set(z,D)}),[...f.entries()].sort((m,A)=>A[1].dl-m[1].dl).slice(0,6)},[r]);if(!e)return l(Ie,{});if(u)return l("div",{class:"wrap err",children:[l("h1",{children:"No galaxy to show"}),l("p",{children:u})]});const O=r==null?void 0:r.root,[X,q]=e.includes("/")?[e.split("/")[0],oe(e)]:["",e],j=n=>{k(n),y(""),n>0&&C({i:n,n:Date.now()})},d=ve({view:"galaxy",model:(O==null?void 0:O.id)??e}),x=O?`${_(r.total)} models are built on ${O.id}. Here is its whole galaxy:`:"",t=r!=null&&r.lineage.length?r.lineage[r.lineage.length-1]:null,s=w?[0,1,2,3].map(n=>w.byRel[n].length):[0,0,0,0],c=w?Array.from(w.order).filter(n=>n>0).slice(0,12):[],a=n=>G[J(r,n)];return l("div",{class:"galaxy",children:[l("div",{class:"wrap g-head",children:[l("div",{class:"crumbs",children:[l("a",{class:"chip",href:ee({view:"galaxy"}),onClick:n=>{n.preventDefault(),Z({view:"galaxy"})},children:"All galaxies"}),t&&l("a",{class:"chip chip-hot",href:ee({view:"galaxy",model:t}),onClick:n=>{n.preventDefault(),Z({view:"galaxy",model:t})},children:["Part of the ",oe(t)," galaxy"]}),l("a",{class:"chip",href:ee({model:e}),onClick:n=>{n.preventDefault(),Z({model:e})},children:"Download history"})]}),l("h1",{class:"model-name",children:[X&&l(ce,{children:[l("span",{class:"org",children:[X,"/"]}),l("wbr",{})]}),l("span",{class:"hl",children:q})]}),l("p",{class:"g-lede",children:r?r.total?l(ce,{children:[l("b",{children:_(r.total)})," models are built on ",q,", directly or through other derivatives. Together with the original they were downloaded ",l("b",{children:se(O.fam_dl30)})," times in the last 30 days."]}):l(ce,{children:["No models on the Hub are built on ",q," yet."]}):"Mapping every model built on it…"})]}),l("div",{class:"wrap o-layout",children:[l("div",{class:"o-stage",children:[r&&w&&r.total>0?l(Fe,{g:r,L:w,hidden:i,sel:p,hoverExt:v,onSel:k,flyTo:P}):l("div",{class:"o-sky o-empty",children:r?l("span",{children:"Nothing orbits this model yet."}):l("span",{class:"g-loading",children:"Mapping the galaxy…"})}),l("ul",{class:"o-key",children:[l("li",{children:[l("span",{class:"k-sun","aria-hidden":"true"}),q," in the center"]}),l("li",{children:[l("span",{class:"k-ring","aria-hidden":"true"}),"one orbit per generation"]}),l("li",{children:[l("span",{class:"k-size","aria-hidden":"true"}),"bigger planet, more downloads"]}),l("li",{children:[l("span",{class:"k-line","aria-hidden":"true"}),"line to the model it was made from"]})]}),r&&w&&r.total>0&&l("div",{class:"g-foot",children:[w.n-1<r.total&&l("p",{class:"muted",children:["Showing the ",_(w.n-1)," most downloaded of ",_(r.total)," models."]}),l("div",{class:"w-actions g-actions",children:[l("button",{class:"btn primary",disabled:R,onClick:async()=>{W(!0);try{const n=await Pe(r,w),f=document.createElement("a");f.href=URL.createObjectURL(n),f.download=`${r.root.id.replace("/","_")}-galaxy.png`,f.click(),setTimeout(()=>URL.revokeObjectURL(f.href),2e3)}finally{W(!1)}},children:R?"Drawing…":"Download image"}),l("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(x)}&url=${encodeURIComponent(d)}`,children:"Post on X"}),l("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(d)}`,children:"LinkedIn"}),l("button",{class:"btn",onClick:()=>{var n;return(n=navigator.clipboard)==null?void 0:n.writeText(d)},children:"Copy link"}),l(Me,{})]})]})]}),r&&w&&r.total>0&&l("aside",{class:"o-panel",children:[l("div",{class:"g-find",children:[l("input",{value:T,onInput:n=>y(n.target.value),placeholder:"Find a model in this galaxy","aria-label":"Find a model in this galaxy",spellcheck:!1,onKeyDown:n=>{n.key==="Enter"&&E.length&&j(E[0]),n.key==="Escape"&&y("")}}),E.length>0&&l("ul",{class:"g-found",children:E.map(n=>l("li",{children:l("button",{onClick:()=>j(n),children:[l("span",{children:r.nodes.id[n]}),l("small",{children:[se(r.nodes.dl30[n]),"/mo"]})]})},n))})]}),p>0&&l("div",{class:"o-sel",children:[l("button",{class:"x","aria-label":"Close",onClick:()=>k(-1),children:"×"}),l("a",{class:"id",href:ee({model:r.nodes.id[p]}),onClick:n=>{n.preventDefault(),Z({model:r.nodes.id[p]})},children:r.nodes.id[p]}),l("span",{class:"g-rel",children:[l("i",{style:{background:a(p).color}}),a(p).of," ",oe(r.nodes.id[r.nodes.parent[p]]),", ",he[w.depth[p]]," generation"]}),l("span",{class:"n",children:[l("b",{children:_(r.nodes.dl30[p])})," downloads in the last 30 days"]}),w.sub[p]>1&&l("span",{class:"n",children:[l("b",{children:_(w.sub[p]-1)})," models built on it"]}),l("div",{class:"acts",children:[l("a",{class:"btn primary",href:ee({model:r.nodes.id[p]}),onClick:n=>{n.preventDefault(),Z({model:r.nodes.id[p]})},children:"Download history"}),w.sub[p]>1&&l("a",{class:"btn",href:ee({view:"galaxy",model:r.nodes.id[p]}),onClick:n=>{n.preventDefault(),Z({view:"galaxy",model:r.nodes.id[p]})},children:"Its own galaxy"})]})]}),l("section",{children:[l("h2",{children:"By kind"}),l("p",{class:"o-note",children:"All generations. Click to show or hide."}),l("div",{class:"o-kinds",role:"group","aria-label":"Show or hide kinds of derivatives",children:ue.filter(n=>s[n]>0).map(n=>l("button",{"aria-pressed":!i[n],onClick:()=>g(i.map((f,m)=>m===n?!f:f)),children:[l("i",{style:{background:G[n].color}}),l("span",{children:G[n].label}),l("b",{children:_(s[n])}),l("span",{class:"share",children:l("span",{style:{width:`${s[n]/(w.n-1)*100}%`,background:G[n].color}})})]},n))}),l("p",{class:"o-gens",children:w.gens.slice(1).map((n,f)=>n?l("span",{children:[l("b",{children:_(n)})," ",he[f+1]," generation"]},f):null)})]}),l("section",{children:[l("h2",{children:"Most downloaded"}),l("ol",{class:"o-top",children:c.map(n=>l("li",{children:l("button",{class:p===n?"on":"",onClick:()=>j(n),onMouseEnter:()=>S(n),onMouseLeave:()=>S(-1),onFocus:()=>S(n),onBlur:()=>S(-1),children:[l("i",{style:{background:a(n).color}}),l("span",{class:"nm",children:r.nodes.id[n]}),l("span",{class:"v",children:se(r.nodes.dl30[n])})]})},n))})]}),Q.length>0&&l("section",{children:[l("h2",{children:"Who builds on it"}),l("ol",{class:"o-top",children:Q.map(([n,f])=>l("li",{children:l("a",{href:ee({author:n}),onClick:m=>{m.preventDefault(),Z({author:n})},children:[l("span",{class:"nm",children:n}),l("span",{class:"v",children:[_(f.n)," ",f.n===1?"model":"models"]})]})},n))})]})]})]})]})}export{Ee as Galaxy};
|
assets/{Report-CZVkPRG8.js → Report-Dj4LbXu5.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-BOlziVv0.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-Cf2k3pP4.js → Repos-B0275klR.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-Dwt6XRc6.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-BOlziVv0.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-BzjG4qIM.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{d as $,A as G,h as E,i as K,u as e,c as U,s as J,b as m,f as w,n as A,a as D,L as Q,S as x,j as I,k as X}from"./index-Dwt6XRc6.js";const Z=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function T({to:n,run:l,format:i=w}){const[a,o]=$(0);return E(()=>{if(!l){o(0);return}if(Z()){o(n);return}let s=0;const t=performance.now(),p=1300,b=F=>{const h=Math.min(1,(F-t)/p);o(n*(1-Math.pow(1-h,3))),h<1&&(s=requestAnimationFrame(b))};return s=requestAnimationFrame(b),()=>cancelAnimationFrame(s)},[n,l]),e(x,{children:i(Math.round(a))})}const ee=n=>{if(n.every_seconds>=1){const l=n.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 n.per_minute>=1e3?`${m(n.per_minute)} downloads every minute`:`${Math.round(n.per_minute)} downloads every minute`},W=n=>n.split("/").slice(1).join("/")||n,S=n=>n.rank<=10?"top 10":n.rank<=100?"top 100":n.rank<=1e3?"top 1,000":n.top_pct==null||n.top_pct>50?null:`top ${n.top_pct<1?n.top_pct.toFixed(1):Math.ceil(n.top_pct)}%`,O=n=>{const l=new Date(n.period.to.slice(0,7)+"-01T00:00:00Z"),i=new Map(n.months.map(a=>[a.month.slice(0,7),a.downloads]));return Array.from({length:12},(a,o)=>{const t=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth()-12+o,1)).toISOString().slice(0,7);return{month:t,downloads:i.get(t)??0}})},B=n=>`${I(n.period.from,{month:"short",year:"numeric"})} – ${I(n.period.to,{month:"short",year:"numeric"})}`;function N({values:n,highlight:l,light:i}){const a=Math.max(...n,1);return e("div",{class:`w-bars${i?" light":""}`,"aria-hidden":"true",children:n.map((o,s)=>e("span",{class:s===l?"hi":"",style:{height:`${Math.max(3,o/a*100)}%`}},s))})}function j(n,l){const i=t=>l===t,a=n.weeks.map(t=>t.downloads),o=n.best_week?n.weeks.findIndex(t=>t.week_of===n.best_week.week_of):-1;return[{key:"intro",tone:"yellow",body:e(x,{children:[e("div",{class:"w-kicker",children:"Model Pulse Wrapped"}),e("div",{class:"w-logo",children:e(U,{size:88})}),e("h2",{class:"w-title",children:[e("span",{class:"w-name",children:n.author}),e("br",{}),"on the Hub"]}),e("p",{class:"w-sub",children:"Your last 12 months, in six cards."}),e("p",{class:"w-mono",children:B(n)})]})},{key:"downloads",tone:"blue",body:e(x,{children:[e("div",{class:"w-kicker",children:"Your models were downloaded"}),e("div",{class:"w-big",children:e(T,{to:n.downloads,run:i(1)})}),e("p",{class:"w-sub",children:["times. That's ",ee(n),"."]}),e(N,{values:O(n).map(t=>t.downloads),light:!0}),e("p",{class:"w-mono",children:"downloads by month"})]})},{key:"top",tone:"paper",body:n.top_model?e(x,{children:[e("div",{class:"w-kicker",children:"Your #1 model this year"}),e("h2",{class:"w-model",children:e("span",{children:W(n.top_model.id)})}),e("div",{class:"w-big sm",children:[e(T,{to:n.top_model.downloads,run:i(2),format:m})," ",e("small",{children:"downloads"})]}),e("p",{class:"w-sub",children:[Math.round(n.top_model.share*100),"% of everything you served",n.top_model.task?`, as ${n.top_model.task.replace(/-/g," ")}`:"","."]}),n.top_models.length>1&&e("ol",{class:"w-list",start:2,children:n.top_models.slice(1,5).map(t=>e("li",{children:[e("span",{children:W(t.id)}),e("b",{children:m(t.downloads)})]},t.id))})]}):e("p",{class:"w-sub",children:"No single model stood out this year."})},{key:"week",tone:"orange",body:n.best_week?e(x,{children:[e("div",{class:"w-kicker",children:"Your biggest week"}),e("h2",{class:"w-title sm",children:["Week of ",I(n.best_week.week_of,{month:"long",day:"numeric",year:"numeric"})]}),e("div",{class:"w-big",children:e(T,{to:n.best_week.downloads,run:i(3)})}),e("p",{class:"w-sub",children:"downloads in seven days."}),e(N,{values:a,highlight:o})]}):e("p",{class:"w-sub",children:"Not enough weeks of data yet."})},{key:"ripple",tone:"green",body:n.ripple.models>0?e(x,{children:[e("div",{class:"w-kicker",children:"Your ripple effect"}),e("div",{class:"w-big",children:e(T,{to:n.ripple.models,run:i(4)})}),e("p",{class:"w-sub",children:["models by other people build on yours. Together they were downloaded ",e("b",{children:m(n.ripple.downloads_30d)})," times last month."]}),n.ripple.top&&e("p",{class:"w-mono",children:["the biggest: ",n.ripple.top.id," (",n.ripple.top.relation,")"]})]}):e(x,{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:n.models_new})," new model",n.models_new===1?"":"s"," this year; one of them could be next."]})]})},{key:"rank",tone:"red",body:e(x,{children:[e("div",{class:"w-kicker",children:["Among ",w(n.authors_ranked)," publishers on the Hub"]}),e("div",{class:"w-big xl",children:["#",e(T,{to:n.rank,run:i(5)})]}),e("p",{class:"w-sub",children:S(n)?n.rank<=1e3?`A ${S(n)} publisher by downloads this year.`:`That's the ${S(n)} by downloads.`:"by downloads this year."}),e("div",{class:"w-chips",children:[e("span",{children:["+",w(n.likes_gained)," likes"]}),e("span",{children:[w(n.models_new)," new models"]}),e("span",{children:[w(n.models_total)," models in total"]})]})]})}]}async function ne(n){await Promise.all(["600 80px 'Fredoka'","500 20px 'IBM Plex Mono'","400 20px 'Source Sans 3'"].map(c=>document.fonts.load(c)));const l=1080,i=1350,a=document.createElement("canvas");a.width=l,a.height=i;const o=a.getContext("2d"),s="#1B1B1F",t="#ECE9E2",p="#FBFAF5",b="#FFD21E",F=(c,u,k,f,v)=>{o.fillStyle=s,o.beginPath(),o.roundRect(c+8,u+8,k,f,26),o.fill(),o.fillStyle=v,o.beginPath(),o.roundRect(c,u,k,f,26),o.fill(),o.lineWidth=4,o.strokeStyle=s,o.stroke()},h=(c,u,k,f,v=s,_)=>{if(o.font=f,o.fillStyle=v,_&&o.measureText(c).width>_){for(;c.length>3&&o.measureText(c+"…").width>_;)c=c.slice(0,-1);c+="…"}o.fillText(c,u,k)};o.fillStyle=t,o.fillRect(0,0,l,i),o.fillStyle=s,o.beginPath(),o.roundRect(68,68,76,76,20),o.fill(),o.fillStyle=b,o.beginPath(),o.roundRect(62,62,72,72,18),o.fill(),o.lineWidth=6,o.strokeStyle=s,o.stroke(),o.beginPath(),o.lineWidth=6,o.lineJoin="round",o.lineCap="round",o.moveTo(74,100),o.lineTo(87,100),o.lineTo(94,81),o.lineTo(106,117),o.lineTo(113,100),o.lineTo(124,100),o.stroke(),h("Model Pulse Wrapped",156,116,"600 44px 'Fredoka'"),h(B(n),62,196,"500 26px 'IBM Plex Mono'","#6E6C66"),o.font="600 92px 'Fredoka'";const C=n.author.length>20?n.author.slice(0,19)+"…":n.author,P=Math.min(l-124,o.measureText(C).width+44);o.fillStyle=b,o.beginPath(),o.roundRect(54,222,P,120,18),o.fill(),h(C,76,314,"600 92px 'Fredoka'",s,l-170),F(62,386,l-124,250,"#3B6FF5"),h("downloads in 12 months",100,446,"500 28px 'IBM Plex Mono'","#fff"),h(w(n.downloads),96,572,"600 118px 'Fredoka'","#fff",l-200);const M=[["#1 model",n.top_model?W(n.top_model.id):"–",n.top_model?`${m(n.top_model.downloads)} downloads`:""],["biggest week",n.best_week?m(n.best_week.downloads):"–",n.best_week?`week of ${I(n.best_week.week_of,{month:"short",day:"numeric"})}`:""],["publisher rank",`#${w(n.rank)}`,S(n)??`of ${m(n.authors_ranked)}`],n.ripple.models>0?["built on yours",w(n.ripple.models),"models by others"]:["published",w(n.models_new),n.models_new===1?"new model this year":"new models this year"]],g=(l-124-32)/2,R=230;M.forEach(([c,u,k],f)=>{const v=62+f%2*(g+32),_=676+Math.floor(f/2)*(R+32);F(v,_,g,R,f===0?b:p),h(c,v+30,_+54,"500 24px 'IBM Plex Mono'","#6E6C66"),h(u,v+28,_+136,`600 ${u.length>14?46:70}px 'Fredoka'`,s,g-56),h(k,v+30,_+190,"400 26px 'Source Sans 3'","#3D3D45",g-60)});const y=O(n).map(c=>c.downloads),r=Math.max(...y,1),d=62,q=1196,V=l-124,L=64,H=6,Y=(V-H*(y.length-1))/Math.max(1,y.length);return y.forEach((c,u)=>{const k=Math.max(4,c/r*L),f=d+u*(Y+H);o.fillStyle=u===y.indexOf(r)?b:p,o.beginPath(),o.roundRect(f,q+L-k,Y,k,4),o.fill(),o.lineWidth=3,o.strokeStyle=s,o.stroke()}),h("modelpulse.ifsp.dev",62,i-40,"500 24px 'IBM Plex Mono'","#6E6C66"),new Promise(c=>a.toBlob(u=>c(u),"image/png"))}function z({initial:n}){const[l,i]=$(n??""),[a,o]=$(null);E(()=>{X.leaderboards().then(o).catch(()=>{})},[]);const s=t=>{const p=t.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];p&&A({view:"wrapped",author:p})};return e("div",{class:"wrap w-entry",children:[e("h1",{children:[e(U,{size:72}),"Model Pulse ",e("span",{class:"hl",children:"Wrapped"})]}),e("p",{class:"lede",children:"Your last 12 months on the Hugging Face Hub, in six cards: total downloads, your #1 model, your biggest week, the models built on yours, and where you rank."}),e("form",{class:"w-form",onSubmit:t=>{t.preventDefault(),s(l)},children:[e("div",{class:"search big",children:e("input",{value:l,onInput:t=>i(t.target.value),placeholder:"Username or org, e.g. Qwen","aria-label":"Username or organization",autoFocus:!0,spellcheck:!1})}),e("button",{class:"btn primary",type:"submit",children:"Get my Wrapped"})]}),a&&e("div",{class:"examples",children:[e("span",{class:"muted",children:"or try"}),a.authors_7d.slice(0,10).map(t=>e("a",{class:"chip",href:D({view:"wrapped",author:t.author}),onClick:p=>{p.preventDefault(),s(t.author)},children:t.author},t.author))]})]})}function le({author:n}){const[l,i]=$(null),[a,o]=$(null),[s,t]=$(0),[p,b]=$(!1),F=G(null);E(()=>{document.title=n?`${n}'s last 12 months on Hugging Face · Model Pulse Wrapped`:"Model Pulse Wrapped: your last 12 months on Hugging Face",i(null),o(null),t(0),n&&fetch(`${K}/api/wrapped/${encodeURIComponent(n)}`).then(async r=>{const d=await r.json();if(!r.ok)throw new Error(d.detail||"Something went wrong");return d}).then(i).catch(r=>o(r.message))},[n]);const h=l?j(l,s).length+1:0,C=()=>t(r=>Math.min(h-1,r+1)),P=()=>t(r=>Math.max(0,r-1));if(E(()=>{if(!l)return;const r=d=>{(d.key==="ArrowRight"||d.key===" ")&&(d.preventDefault(),C()),d.key==="ArrowLeft"&&P()};return addEventListener("keydown",r),()=>removeEventListener("keydown",r)},[l,h]),!n)return e(z,{});if(a)return e("div",{class:"wrap w-entry",children:[e("h1",{class:"w-err",children:["No Wrapped for ",n," yet"]}),e("p",{class:"lede",children:a}),e(z,{initial:""})]});if(!l)return e("div",{class:"wrap w-loading",children:[e(U,{size:64}),e("p",{children:["Crunching 12 months of downloads for ",e("b",{children:n}),"…"]})]});const M=j(l,s),g=J({view:"wrapped",author:l.author}),R=`My last 12 months on the Hugging Face Hub: ${m(l.downloads)} downloads${S(l)&&(l.rank<=1e3||(l.top_pct??100)<=10)?`, ${S(l)} of publishers`:""}. Get your Model Pulse Wrapped:`,y=s===M.length;return e("div",{class:"wrap w-page",children:e("div",{class:"w-stage",ref:F,children:[e("div",{class:"w-progress","aria-hidden":"true",children:Array.from({length:h},(r,d)=>e("span",{class:d<s?"done":d===s?"now":""},d))}),y?e("div",{class:"w-card tone-paper w-summary",children:[e("div",{class:"w-kicker",children:B(l)}),e("h2",{class:"w-title sm",children:e("span",{class:"w-name",children:l.author})}),e("div",{class:"w-grid",children:[e("div",{class:"t blue",children:[e("span",{children:"downloads"}),e("b",{children:m(l.downloads)})]}),e("div",{class:"t",children:[e("span",{children:"#1 model"}),e("b",{class:"s",children:l.top_model?W(l.top_model.id):"–"})]}),e("div",{class:"t",children:[e("span",{children:"biggest week"}),e("b",{children:l.best_week?m(l.best_week.downloads):"–"})]}),e("div",{class:"t yellow",children:[e("span",{children:"publisher rank"}),e("b",{children:["#",w(l.rank)]})]}),l.ripple.models>0?e("div",{class:"t",children:[e("span",{children:"built on yours"}),e("b",{children:w(l.ripple.models)})]}):e("div",{class:"t",children:[e("span",{children:"new models"}),e("b",{children:w(l.models_new)})]}),e("div",{class:"t",children:[e("span",{children:"likes gained"}),e("b",{children:["+",m(l.likes_gained)]})]})]}),e("div",{class:"w-actions",children:[e("button",{class:"btn primary",disabled:p,onClick:async()=>{b(!0);try{const r=await ne(l),d=document.createElement("a");d.href=URL.createObjectURL(r),d.download=`${l.author}-model-pulse-wrapped.png`,d.click(),setTimeout(()=>URL.revokeObjectURL(d.href),2e3)}finally{b(!1)}},children:p?"Drawing…":"Download image"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(R)}&url=${encodeURIComponent(g)}`,children:"Post on X"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(g)}`,children:"LinkedIn"}),e("button",{class:"btn",onClick:()=>{var r;return(r=navigator.clipboard)==null?void 0:r.writeText(g)},children:"Copy link"})]}),e("div",{class:"w-more",children:[e("a",{href:D({author:l.author}),onClick:r=>{r.preventDefault(),A({author:l.author})},children:["See ",l.author,"'s models"]}),e("a",{href:D({view:"wrapped"}),onClick:r=>{r.preventDefault(),A({view:"wrapped"})},children:"Try another name"})]}),e("div",{class:"w-like",children:e(Q,{})})]},"summary"):e("div",{class:`w-card tone-${M[s].tone}`,"aria-live":"polite",children:[M[s].body,e("button",{class:"w-tap left","aria-label":"Previous card",onClick:P}),e("button",{class:"w-tap right","aria-label":"Next card",onClick:C})]},M[s].key),e("div",{class:"w-nav",children:[e("button",{class:"btn",onClick:P,disabled:s===0,children:"Back"}),e("span",{class:"w-mono",children:[s+1," / ",h]}),e("button",{class:"btn primary",onClick:C,disabled:y,children:s===M.length-1?"Summary":"Next"})]})]})})}export{le as Wrapped};
|
|
|
|
|
|
assets/Wrapped-DdM9WiHd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{d as _,A as G,h as E,i as J,u as e,c as W,s as Q,b as g,f as m,n as I,a as U,L as X,S as C,j as R,k as N}from"./index-BOlziVv0.js";const Z=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function D({to:n,run:o,format:d=m}){const[a,t]=_(0);return E(()=>{if(!o){t(0);return}if(Z()){t(n);return}let l=0;const r=performance.now(),k=1300,w=x=>{const p=Math.min(1,(x-r)/k);t(n*(1-Math.pow(1-p,3))),p<1&&(l=requestAnimationFrame(w))};return l=requestAnimationFrame(w),()=>cancelAnimationFrame(l)},[n,o]),e(C,{children:d(Math.round(a))})}const ee=n=>{if(n.every_seconds>=1){const o=n.every_seconds;return o<60?`one download every ${o.toFixed(o<10?1:0)} seconds`:o<3600?`one download every ${Math.round(o/60)} minutes`:`one download every ${Math.round(o/3600)} hours`}return n.per_minute>=1e3?`${g(n.per_minute)} downloads every minute`:`${Math.round(n.per_minute)} downloads every minute`},A=n=>n.split("/").slice(1).join("/")||n,T=n=>n.rank<=10?"top 10":n.rank<=100?"top 100":n.rank<=1e3?"top 1,000":n.top_pct==null||n.top_pct>50?null:`top ${n.top_pct<1?n.top_pct.toFixed(1):Math.ceil(n.top_pct)}%`,q=n=>{const o=new Date(n.period.to.slice(0,7)+"-01T00:00:00Z"),d=new Map(n.months.map(a=>[a.month.slice(0,7),a.downloads]));return Array.from({length:12},(a,t)=>{const r=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()-12+t,1)).toISOString().slice(0,7);return{month:r,downloads:d.get(r)??0}})},B=n=>`${R(n.period.from,{month:"short",year:"numeric"})} – ${R(n.period.to,{month:"short",year:"numeric"})}`;function O({values:n,highlight:o,light:d}){const a=Math.max(...n,1);return e("div",{class:`w-bars${d?" light":""}`,"aria-hidden":"true",children:n.map((t,l)=>e("span",{class:l===o?"hi":"",style:{height:`${Math.max(3,t/a*100)}%`}},l))})}function j(n,o){const d=r=>o===r,a=n.weeks.map(r=>r.downloads),t=n.best_week?n.weeks.findIndex(r=>r.week_of===n.best_week.week_of):-1;return[{key:"intro",tone:"yellow",body:e(C,{children:[e("div",{class:"w-kicker",children:"Model Pulse Wrapped"}),e("div",{class:"w-logo",children:e(W,{size:88})}),e("h2",{class:"w-title",children:[e("span",{class:"w-name",children:n.author}),e("br",{}),"on the Hub"]}),e("p",{class:"w-sub",children:"Your last 12 months, in six cards."}),e("p",{class:"w-mono",children:B(n)})]})},{key:"downloads",tone:"blue",body:e(C,{children:[e("div",{class:"w-kicker",children:"Your models were downloaded"}),e("div",{class:"w-big",children:e(D,{to:n.downloads,run:d(1)})}),e("p",{class:"w-sub",children:["times. That's ",ee(n),"."]}),e(O,{values:q(n).map(r=>r.downloads),light:!0}),e("p",{class:"w-mono",children:"downloads by month"})]})},{key:"top",tone:"paper",body:n.top_model?e(C,{children:[e("div",{class:"w-kicker",children:"Your #1 model this year"}),e("h2",{class:"w-model",children:e("span",{children:A(n.top_model.id)})}),e("div",{class:"w-big sm",children:[e(D,{to:n.top_model.downloads,run:d(2),format:g})," ",e("small",{children:"downloads"})]}),e("p",{class:"w-sub",children:[Math.round(n.top_model.share*100),"% of everything you served",n.top_model.task?`, as ${n.top_model.task.replace(/-/g," ")}`:"","."]}),n.top_models.length>1&&e("ol",{class:"w-list",start:2,children:n.top_models.slice(1,5).map(r=>e("li",{children:[e("span",{children:A(r.id)}),e("b",{children:g(r.downloads)})]},r.id))})]}):e("p",{class:"w-sub",children:"No single model stood out this year."})},{key:"week",tone:"orange",body:n.best_week?e(C,{children:[e("div",{class:"w-kicker",children:"Your biggest week"}),e("h2",{class:"w-title sm",children:["Week of ",R(n.best_week.week_of,{month:"long",day:"numeric",year:"numeric"})]}),e("div",{class:"w-big",children:e(D,{to:n.best_week.downloads,run:d(3)})}),e("p",{class:"w-sub",children:"downloads in seven days."}),e(O,{values:a,highlight:t})]}):e("p",{class:"w-sub",children:"Not enough weeks of data yet."})},{key:"ripple",tone:"green",body:n.ripple.models>0?e(C,{children:[e("div",{class:"w-kicker",children:"Your ripple effect"}),e("div",{class:"w-big",children:e(D,{to:n.ripple.models,run:d(4)})}),e("p",{class:"w-sub",children:["models by other people build on yours. Together they were downloaded ",e("b",{children:g(n.ripple.downloads_30d)})," times last month."]}),n.ripple.top&&e("p",{class:"w-mono",children:["the biggest: ",n.ripple.top.id," (",n.ripple.top.relation,")"]})]}):e(C,{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:n.models_new})," new model",n.models_new===1?"":"s"," this year; one of them could be next."]})]})},{key:"rank",tone:"red",body:e(C,{children:[e("div",{class:"w-kicker",children:["Among ",m(n.authors_ranked)," publishers on the Hub"]}),e("div",{class:"w-big xl",children:["#",e(D,{to:n.rank,run:d(5)})]}),e("p",{class:"w-sub",children:T(n)?n.rank<=1e3?`A ${T(n)} publisher by downloads this year.`:`That's the ${T(n)} by downloads.`:"by downloads this year."}),e("div",{class:"w-chips",children:[e("span",{children:["+",m(n.likes_gained)," likes"]}),e("span",{children:[m(n.models_new)," new models"]}),e("span",{children:[m(n.models_total)," models in total"]})]})]})}]}async function ne(n){await Promise.all(["600 80px 'Fredoka'","500 20px 'IBM Plex Mono'","400 20px 'Source Sans 3'"].map(h=>document.fonts.load(h)));const o=1080,d=1350,a=document.createElement("canvas");a.width=o,a.height=d;const t=a.getContext("2d"),l="#1B1B1F",r="#ECE9E2",k="#FBFAF5",w="#FFD21E",x=(h,b,M,v,F)=>{t.fillStyle=l,t.beginPath(),t.roundRect(h+8,b+8,M,v,26),t.fill(),t.fillStyle=F,t.beginPath(),t.roundRect(h,b,M,v,26),t.fill(),t.lineWidth=4,t.strokeStyle=l,t.stroke()},p=(h,b,M,v,F=l,S)=>{if(t.font=v,t.fillStyle=F,S&&t.measureText(h).width>S){for(;h.length>3&&t.measureText(h+"…").width>S;)h=h.slice(0,-1);h+="…"}t.fillText(h,b,M)};t.fillStyle=r,t.fillRect(0,0,o,d),t.fillStyle=l,t.beginPath(),t.roundRect(68,68,76,76,20),t.fill(),t.fillStyle=w,t.beginPath(),t.roundRect(62,62,72,72,18),t.fill(),t.lineWidth=6,t.strokeStyle=l,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(),p("Model Pulse Wrapped",156,116,"600 44px 'Fredoka'"),p(B(n),62,196,"500 26px 'IBM Plex Mono'","#6E6C66"),t.font="600 92px 'Fredoka'";const y=n.author.length>20?n.author.slice(0,19)+"…":n.author,s=Math.min(o-124,t.measureText(y).width+44);t.fillStyle=w,t.beginPath(),t.roundRect(54,222,s,120,18),t.fill(),p(y,76,314,"600 92px 'Fredoka'",l,o-170),x(62,386,o-124,250,"#3B6FF5"),p("downloads in 12 months",100,446,"500 28px 'IBM Plex Mono'","#fff"),p(m(n.downloads),96,572,"600 118px 'Fredoka'","#fff",o-200);const c=[["#1 model",n.top_model?A(n.top_model.id):"–",n.top_model?`${g(n.top_model.downloads)} downloads`:""],["biggest week",n.best_week?g(n.best_week.downloads):"–",n.best_week?`week of ${R(n.best_week.week_of,{month:"short",day:"numeric"})}`:""],["publisher rank",`#${m(n.rank)}`,T(n)??`of ${g(n.authors_ranked)}`],n.ripple.models>0?["built on yours",m(n.ripple.models),"models by others"]:["published",m(n.models_new),n.models_new===1?"new model this year":"new models this year"]],f=(o-124-32)/2,P=230;c.forEach(([h,b,M],v)=>{const F=62+v%2*(f+32),S=676+Math.floor(v/2)*(P+32);x(F,S,f,P,v===0?w:k),p(h,F+30,S+54,"500 24px 'IBM Plex Mono'","#6E6C66"),p(b,F+28,S+136,`600 ${b.length>14?46:70}px 'Fredoka'`,l,f-56),p(M,F+30,S+190,"400 26px 'Source Sans 3'","#3D3D45",f-60)});const $=q(n).map(h=>h.downloads),i=Math.max(...$,1),u=62,K=1196,V=o-124,L=64,H=6,Y=(V-H*($.length-1))/Math.max(1,$.length);return $.forEach((h,b)=>{const M=Math.max(4,h/i*L),v=u+b*(Y+H);t.fillStyle=b===$.indexOf(i)?w:k,t.beginPath(),t.roundRect(v,K+L-M,Y,M,4),t.fill(),t.lineWidth=3,t.strokeStyle=l,t.stroke()}),p("modelpulse.ifsp.dev",62,d-40,"500 24px 'IBM Plex Mono'","#6E6C66"),new Promise(h=>a.toBlob(b=>h(b),"image/png"))}function z({initial:n}){const[o,d]=_(n??""),[a,t]=_([]),[l,r]=_(-1),[k,w]=_(!1);E(()=>{const s=o.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];if(s.length<2){t([]);return}let c=!0;const f=setTimeout(()=>N.searchAuthors(s).then(P=>{c&&(t(P),r(-1))}).catch(()=>{}),120);return()=>{c=!1,clearTimeout(f)}},[o]);const[x,p]=_(null);E(()=>{N.leaderboards().then(p).catch(()=>{})},[]);const y=s=>{const c=s.trim().replace(/^https?:\/\/huggingface\.co\//,"").split("/")[0];c&&I({view:"wrapped",author:c})};return e("div",{class:"wrap w-entry",children:[e("h1",{children:[e(W,{size:72}),"Model Pulse ",e("span",{class:"hl",children:"Wrapped"})]}),e("p",{class:"lede",children:"Your last 12 months on the Hugging Face Hub, in six cards: total downloads, your #1 model, your biggest week, the models built on yours, and where you rank."}),e("form",{class:"w-form",onSubmit:s=>{s.preventDefault(),y(l>=0&&a[l]?a[l].author:o)},children:[e("div",{class:"search big",children:[e("input",{value:o,onInput:s=>{d(s.target.value),w(!0)},placeholder:"Username or org, e.g. Qwen","aria-label":"Username or organization",autoFocus:!0,spellcheck:!1,autocomplete:"off",role:"combobox","aria-expanded":k&&a.length>0,"aria-controls":"wrapped-results",onFocus:()=>w(!0),onBlur:()=>setTimeout(()=>w(!1),150),onKeyDown:s=>{s.key==="ArrowDown"?(s.preventDefault(),r(c=>Math.min(c+1,a.length-1))):s.key==="ArrowUp"?(s.preventDefault(),r(c=>Math.max(c-1,-1))):s.key==="Escape"&&w(!1)}}),k&&a.length>0&&e("ul",{class:"results",id:"wrapped-results",role:"listbox",children:a.map((s,c)=>e("li",{role:"option","aria-selected":c===l,onMouseEnter:()=>r(c),onMouseDown:f=>{f.preventDefault(),y(s.author)},children:[e("span",{class:"rid",children:s.author}),e("span",{class:"rmeta",children:[m(s.models)," model",s.models===1?"":"s"," · ",g(s.dl30??0),"/mo"]})]},s.author))})]}),e("button",{class:"btn primary",type:"submit",children:"Get my Wrapped"})]}),x&&e("div",{class:"examples",children:[e("span",{class:"muted",children:"or try"}),x.authors_7d.slice(0,10).map(s=>e("a",{class:"chip",href:U({view:"wrapped",author:s.author}),onClick:c=>{c.preventDefault(),y(s.author)},children:s.author},s.author))]})]})}function oe({author:n}){const[o,d]=_(null),[a,t]=_(null),[l,r]=_(0),[k,w]=_(!1),x=G(null);E(()=>{document.title=n?`${n}'s last 12 months on Hugging Face · Model Pulse Wrapped`:"Model Pulse Wrapped: your last 12 months on Hugging Face",d(null),t(null),r(0),n&&fetch(`${J}/api/wrapped/${encodeURIComponent(n)}`).then(async i=>{const u=await i.json();if(!i.ok)throw new Error(u.detail||"Something went wrong");return u}).then(d).catch(i=>t(i.message))},[n]);const p=o?j(o,l).length+1:0,y=()=>r(i=>Math.min(p-1,i+1)),s=()=>r(i=>Math.max(0,i-1));if(E(()=>{if(!o)return;const i=u=>{(u.key==="ArrowRight"||u.key===" ")&&(u.preventDefault(),y()),u.key==="ArrowLeft"&&s()};return addEventListener("keydown",i),()=>removeEventListener("keydown",i)},[o,p]),!n)return e(z,{});if(a)return e("div",{class:"wrap w-entry",children:[e("h1",{class:"w-err",children:["No Wrapped for ",n," yet"]}),e("p",{class:"lede",children:a}),e(z,{initial:""})]});if(!o)return e("div",{class:"wrap w-loading",children:[e(W,{size:64}),e("p",{children:["Crunching 12 months of downloads for ",e("b",{children:n}),"…"]})]});const c=j(o,l),f=Q({view:"wrapped",author:o.author}),P=`My last 12 months on the Hugging Face Hub: ${g(o.downloads)} downloads${T(o)&&(o.rank<=1e3||(o.top_pct??100)<=10)?`, ${T(o)} of publishers`:""}. Get your Model Pulse Wrapped:`,$=l===c.length;return e("div",{class:"wrap w-page",children:e("div",{class:"w-stage",ref:x,children:[e("div",{class:"w-progress","aria-hidden":"true",children:Array.from({length:p},(i,u)=>e("span",{class:u<l?"done":u===l?"now":""},u))}),$?e("div",{class:"w-card tone-paper w-summary",children:[e("div",{class:"w-kicker",children:B(o)}),e("h2",{class:"w-title sm",children:e("span",{class:"w-name",children:o.author})}),e("div",{class:"w-grid",children:[e("div",{class:"t blue",children:[e("span",{children:"downloads"}),e("b",{children:g(o.downloads)})]}),e("div",{class:"t",children:[e("span",{children:"#1 model"}),e("b",{class:"s",children:o.top_model?A(o.top_model.id):"–"})]}),e("div",{class:"t",children:[e("span",{children:"biggest week"}),e("b",{children:o.best_week?g(o.best_week.downloads):"–"})]}),e("div",{class:"t yellow",children:[e("span",{children:"publisher rank"}),e("b",{children:["#",m(o.rank)]})]}),o.ripple.models>0?e("div",{class:"t",children:[e("span",{children:"built on yours"}),e("b",{children:m(o.ripple.models)})]}):e("div",{class:"t",children:[e("span",{children:"new models"}),e("b",{children:m(o.models_new)})]}),e("div",{class:"t",children:[e("span",{children:"likes gained"}),e("b",{children:["+",g(o.likes_gained)]})]})]}),e("div",{class:"w-actions",children:[e("button",{class:"btn primary",disabled:k,onClick:async()=>{w(!0);try{const i=await ne(o),u=document.createElement("a");u.href=URL.createObjectURL(i),u.download=`${o.author}-model-pulse-wrapped.png`,u.click(),setTimeout(()=>URL.revokeObjectURL(u.href),2e3)}finally{w(!1)}},children:k?"Drawing…":"Download image"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(P)}&url=${encodeURIComponent(f)}`,children:"Post on X"}),e("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(f)}`,children:"LinkedIn"}),e("button",{class:"btn",onClick:()=>{var i;return(i=navigator.clipboard)==null?void 0:i.writeText(f)},children:"Copy link"})]}),e("div",{class:"w-more",children:[e("a",{href:U({author:o.author}),onClick:i=>{i.preventDefault(),I({author:o.author})},children:["See ",o.author,"'s models"]}),e("a",{href:U({view:"wrapped"}),onClick:i=>{i.preventDefault(),I({view:"wrapped"})},children:"Try another name"})]}),e("div",{class:"w-like",children:e(X,{})})]},"summary"):e("div",{class:`w-card tone-${c[l].tone}`,"aria-live":"polite",children:[c[l].body,e("button",{class:"w-tap left","aria-label":"Previous card",onClick:s}),e("button",{class:"w-tap right","aria-label":"Next card",onClick:y})]},c[l].key),e("div",{class:"w-nav",children:[e("button",{class:"btn",onClick:s,disabled:l===0,children:"Back"}),e("span",{class:"w-mono",children:[l+1," / ",p]}),e("button",{class:"btn primary",onClick:y,disabled:$,children:l===c.length-1?"Summary":"Next"})]})]})})}export{oe as Wrapped};
|
assets/{index-Dwt6XRc6.js → index-BOlziVv0.js}
RENAMED
|
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-BV4HyR66.css">
|
| 32 |
</head>
|
| 33 |
<body>
|
|
|
|
| 27 |
});
|
| 28 |
}
|
| 29 |
</script>
|
| 30 |
+
<script type="module" crossorigin src="/assets/index-BOlziVv0.js"></script>
|
| 31 |
<link rel="stylesheet" crossorigin href="/assets/index-BV4HyR66.css">
|
| 32 |
</head>
|
| 33 |
<body>
|