import{s as z,n as V,o as v}from"../chunks/scheduler.d6170356.js";import{S as _,i as $,g as I,s as p,r as f,A as F,h as i,f as a,c as t,j as X,u as N,x as G,k as Y,y as x,a as n,v as b,d as q,t as Z,w as S}from"../chunks/index.fcd4cc08.js";import{C as D}from"../chunks/CodeBlock.7b16bdef.js";import{H as k}from"../chunks/Heading.8660bd0e.js";function L(g){let M,A,U,h,j,C,c,e,u,R="Counting the number of downloads for models is not a trivial task as a single model repository might contain multiple files, including multiple model weight files (e.g., with sharded models), and different formats depending on the library. To avoid double counting downloads (e.g., counting a single download of a model as multiple downloads), the Hub uses a set of query files that are employed for download counting. No information is sent from the user, and no additional calls are made for this. The count is done server-side as we serve files for downloads.",d,J,W="Every HTTP request to these files, including <code>GET</code> and <code>HEAD</code> will be counted as a download. By default, when no library is specified, the Hub uses <code>config.json</code> as the default query file. Otherwise, the query file depends on each library, and the Hub might examine files such as <code>pytorch_model.bin</code> and <code>adapter_config.json</code>.",r,T,B,o,H="By default, the Hub looks at <code>config.json</code>, <code>config.yaml</code>, <code>hyperparams.yaml</code>, and <code>meta.yaml</code>. For the following set of libraries, there are specific query files",m,w,E,y,Q;return j=new k({props:{title:"Models Download Stats",local:"models-download-stats",headingTag:"h1"}}),c=new k({props:{title:"How are download stats generated for models?",local:"how-are-download-stats-generated-for-models",headingTag:"h2"}}),T=new k({props:{title:"Which are the query files for different libraries?",local:"which-are-the-query-files-for-different-libraries",headingTag:"h2"}}),w=new D({props:{code:" ",highlighted:`<span class="hljs-punctuation">{</span>
    <span class="hljs-attr">&quot;adapter-transformers&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;adapter_config.json&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;asteroid&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;pytorch_model.bin&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;flair&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;pytorch_model.bin&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;keras&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;saved_model.pb&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;ml-agents&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.onnx&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;nemo&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.nemo&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;open_clip&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*pytorch_model.bin&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;sample-factory&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;cfg.json&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;paddlenlp&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;model_config.json&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;speechbrain&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;hyperparams.yaml&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;sklearn&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;sklearn_model.joblib&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;spacy&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.whl&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;stanza&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;models/default.zip&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;stable-baselines3&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.zip&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;timm&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                terms<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">&quot;pytorch_model.bin&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;model.safetensors&quot;</span><span class="hljs-punctuation">]</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;diffusers&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        <span class="hljs-comment">/// Filter out nested safetensors and pickle weights to avoid double counting downloads from the diffusers lib</span>
        must_not<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*/*.safetensors&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*/*.bin&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
        <span class="hljs-comment">/// Include documents that match at least one of the following rules</span>
        should<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-comment">/// Downloaded from diffusers lib</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;model_index.json&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-comment">/// Direct downloads (LoRa, Auto1111 and others)</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.safetensors&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.ckpt&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">{</span>
                wildcard<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;*.bin&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
        minimum_should_match<span class="hljs-punctuation">:</span> <span class="hljs-number">1</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;peft&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
        filter<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
            <span class="hljs-punctuation">{</span>
                term<span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> path<span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;adapter_config.json&quot;</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
            <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),{c(){M=I("meta"),A=p(),U=I("p"),h=p(),f(j.$$.fragment),C=p(),f(c.$$.fragment),e=p(),u=I("p"),u.textContent=R,d=p(),J=I("p"),J.innerHTML=W,r=p(),f(T.$$.fragment),B=p(),o=I("p"),o.innerHTML=H,m=p(),f(w.$$.fragment),E=p(),y=I("p"),this.h()},l(s){const l=F("svelte-u9bgzb",document.head);M=i(l,"META",{name:!0,content:!0}),l.forEach(a),A=t(s),U=i(s,"P",{}),X(U).forEach(a),h=t(s),N(j.$$.fragment,s),C=t(s),N(c.$$.fragment,s),e=t(s),u=i(s,"P",{"data-svelte-h":!0}),G(u)!=="svelte-oi4ol7"&&(u.textContent=R),d=t(s),J=i(s,"P",{"data-svelte-h":!0}),G(J)!=="svelte-1a3p1jt"&&(J.innerHTML=W),r=t(s),N(T.$$.fragment,s),B=t(s),o=i(s,"P",{"data-svelte-h":!0}),G(o)!=="svelte-qgthum"&&(o.innerHTML=H),m=t(s),N(w.$$.fragment,s),E=t(s),y=i(s,"P",{}),X(y).forEach(a),this.h()},h(){Y(M,"name","hf:doc:metadata"),Y(M,"content",P)},m(s,l){x(document.head,M),n(s,A,l),n(s,U,l),n(s,h,l),b(j,s,l),n(s,C,l),b(c,s,l),n(s,e,l),n(s,u,l),n(s,d,l),n(s,J,l),n(s,r,l),b(T,s,l),n(s,B,l),n(s,o,l),n(s,m,l),b(w,s,l),n(s,E,l),n(s,y,l),Q=!0},p:V,i(s){Q||(q(j.$$.fragment,s),q(c.$$.fragment,s),q(T.$$.fragment,s),q(w.$$.fragment,s),Q=!0)},o(s){Z(j.$$.fragment,s),Z(c.$$.fragment,s),Z(T.$$.fragment,s),Z(w.$$.fragment,s),Q=!1},d(s){s&&(a(A),a(U),a(h),a(C),a(e),a(u),a(d),a(J),a(r),a(B),a(o),a(m),a(E),a(y)),a(M),S(j,s),S(c,s),S(T,s),S(w,s)}}}const P='{"title":"Models Download Stats","local":"models-download-stats","sections":[{"title":"How are download stats generated for models?","local":"how-are-download-stats-generated-for-models","sections":[],"depth":2},{"title":"Which are the query files for different libraries?","local":"which-are-the-query-files-for-different-libraries","sections":[],"depth":2}],"depth":1}';function K(g){return v(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ns extends _{constructor(M){super(),$(this,M,K,L,z,{})}}export{ns as component};
